diff options
| author | Eli Friedman <eli.friedman@gmail.com> | 2013-07-22 23:30:13 +0000 |
|---|---|---|
| committer | Eli Friedman <eli.friedman@gmail.com> | 2013-07-22 23:30:13 +0000 |
| commit | d1eec9cc96fed4ca04dd512db0d1f72000ddf33f (patch) | |
| tree | 7021d4f23766084167e8540854217c0df8746ce7 | |
| parent | 8e1a6e7d536552164ce59ace18e087092b246549 (diff) | |
| download | bcm5719-llvm-d1eec9cc96fed4ca04dd512db0d1f72000ddf33f.tar.gz bcm5719-llvm-d1eec9cc96fed4ca04dd512db0d1f72000ddf33f.zip | |
Testcase for PR16673.
llvm-svn: 186891
| -rw-r--r-- | clang/test/SemaCXX/warn-logical-not-compare.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/clang/test/SemaCXX/warn-logical-not-compare.cpp b/clang/test/SemaCXX/warn-logical-not-compare.cpp index 7e7e3a75922..3ecce474f14 100644 --- a/clang/test/SemaCXX/warn-logical-not-compare.cpp +++ b/clang/test/SemaCXX/warn-logical-not-compare.cpp @@ -177,3 +177,18 @@ bool test2 (E e) { return ret; } + +bool PR16673(int x) { + bool ret; + // Make sure we don't emit a fixit for the left paren, but not the right paren. +#define X(x) x + ret = X(!x == 1 && 1); + // expected-warning@-1 {{logical not is only applied to the left hand side of this comparison}} + // expected-note@-2 {{add parentheses after the '!' to evaluate the comparison first}} + // expected-note@-3 {{add parentheses around left hand side expression to silence this warning}} + // CHECK: to evaluate the comparison first + // CHECK-NOT: fix-it + // CHECK: to silence this warning + // CHECK-NOT: fix-it + return ret; +} |

