summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaCXX/warn-assignment-condition.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test/SemaCXX/warn-assignment-condition.cpp')
-rw-r--r--clang/test/SemaCXX/warn-assignment-condition.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/clang/test/SemaCXX/warn-assignment-condition.cpp b/clang/test/SemaCXX/warn-assignment-condition.cpp
index 7596bb26aea..ab9d2ad4a57 100644
--- a/clang/test/SemaCXX/warn-assignment-condition.cpp
+++ b/clang/test/SemaCXX/warn-assignment-condition.cpp
@@ -124,3 +124,13 @@ void test2() {
// expected-note {{remove extraneous parentheses around the comparison to silence this warning}}
if ((test2 == fn)) {}
}
+
+// Do not warn about extra '()' used within a macro. This pattern
+// occurs frequently.
+#define COMPARE(x,y) (x == y)
+int test3(int x, int y) {
+ if (COMPARE(x, y)) // no-warning
+ return 0;
+ return 1;
+}
+
OpenPOWER on IntegriCloud