summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaCXX/warn-logical-not-compare.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Expand -Wlogical-not-parentheses to also fire on `!x & A`.Nico Weber2016-10-271-1/+40
| | | | | | | | | | | | | This is a misspelling of the intended !(x & A) negated bit test that happens in practice every now and then. I ran this on Chromium and all its dependencies, and it fired 0 times -- no false or true positives, but it would've caught a bug in an in-progress change that had to be caught by a Visual Studio warning instead. https://reviews.llvm.org/D26035 llvm-svn: 285310
* Make a test less brittle.Richard Trieu2015-08-171-44/+56
| | | | | | Capture line numbers in a variable for FileCheck instead of hardcoding them. llvm-svn: 245250
* Testcase for PR16673.Eli Friedman2013-07-221-0/+15
| | | | llvm-svn: 186891
* Improve -Wlogical-not-parentheses to catch when the not is applied to an enum.Richard Trieu2013-07-041-0/+67
| | | | llvm-svn: 185602
* Add a new warning, -Wlogical-not-parentheses, to -Wparentheses.Richard Trieu2013-06-101-0/+112
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
OpenPOWER on IntegriCloud