Select Git revision
SemaChecking.cpp
-
Richard Trieu authored
New default warning that triggers when an unsigned zero is used in a call to std::max. For unsigned values, zero is the minimum value, so any call to std::max is always equal to the other value. A common pattern was to take the max of zero and the difference of two unsigned values, not taking into account that unsigned values wrap around below zero. This warning also emits a note with a fixit hint to remove the zero and call to std::max. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@288732 91177308-0d34-0410-b5e6-96231b3b80d8
Richard Trieu authoredNew default warning that triggers when an unsigned zero is used in a call to std::max. For unsigned values, zero is the minimum value, so any call to std::max is always equal to the other value. A common pattern was to take the max of zero and the difference of two unsigned values, not taking into account that unsigned values wrap around below zero. This warning also emits a note with a fixit hint to remove the zero and call to std::max. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@288732 91177308-0d34-0410-b5e6-96231b3b80d8