diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2011-02-01 22:23:56 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2011-02-01 22:23:56 +0000 |
commit | cf1620a0ef7f6dc71f4fad5c46fbb0a2de6c6308 (patch) | |
tree | b86f49a4de6c5a89ae57675e33ff0318ba3dc5bf /test/SemaCXX/warn-assignment-condition.cpp | |
parent | 7143325db76d6c3dabce82500f8cc7c93a941970 (diff) |
Don't warn for "if ((a == b))" if the parens came from a macro. Thanks to Fariborz for the hint!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124689 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaCXX/warn-assignment-condition.cpp')
-rw-r--r-- | test/SemaCXX/warn-assignment-condition.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/test/SemaCXX/warn-assignment-condition.cpp b/test/SemaCXX/warn-assignment-condition.cpp index 6cfab55440..7596bb26ae 100644 --- a/test/SemaCXX/warn-assignment-condition.cpp +++ b/test/SemaCXX/warn-assignment-condition.cpp @@ -110,6 +110,10 @@ void test() { // expected-note {{use '=' to turn this equality comparison into an assignment}} \ // expected-note {{remove extraneous parentheses around the comparison to silence this warning}} if ((5 == x)) {} + +#define EQ(x,y) ((x) == (y)) + if (EQ(x, 5)) {} +#undef EQ } void (*fn)(); |