aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Basic/IdentifierTable.cpp
diff options
context:
space:
mode:
authorRichard Trieu <rtrieu@google.com>2013-06-10 18:52:07 +0000
committerRichard Trieu <rtrieu@google.com>2013-06-10 18:52:07 +0000
commitbb4b894e0b2d0c39d40a178872127a5cd6becd8e (patch)
treed856d2a862f5d8d5e750454ce179086b306e896c /clang/lib/Basic/IdentifierTable.cpp
parent4c44032aa1e5c198144db0a1d0c72280009418df (diff)
downloadllvm-bb4b894e0b2d0c39d40a178872127a5cd6becd8e.zip
llvm-bb4b894e0b2d0c39d40a178872127a5cd6becd8e.tar.gz
llvm-bb4b894e0b2d0c39d40a178872127a5cd6becd8e.tar.bz2
Add a new warning, -Wlogical-not-parentheses, to -Wparentheses.
This warning triggers on the logical not of a non-boolean expression on the left hand side of comparison. Often, the user meant to negate the comparison, not just the left hand side of the comparison. Two notes are also emitted, the first with a fix-it to add parentheses around the comparison, and the other to put parenthesis around the not expression to silence the warning. bool not_equal(int x, int y) { return !x == y; // warn here } return !(x == y); // first fix-it, to negate comparison. return (!x) == y; // second fix-it, to silence warning. llvm-svn: 183688
Diffstat (limited to 'clang/lib/Basic/IdentifierTable.cpp')
0 files changed, 0 insertions, 0 deletions