summaryrefslogtreecommitdiff
path: root/test/SemaCXX/warn-assignment-condition.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/SemaCXX/warn-assignment-condition.cpp')
-rw-r--r--test/SemaCXX/warn-assignment-condition.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/SemaCXX/warn-assignment-condition.cpp b/test/SemaCXX/warn-assignment-condition.cpp
index c0ef35b252d85..04f2e79525475 100644
--- a/test/SemaCXX/warn-assignment-condition.cpp
+++ b/test/SemaCXX/warn-assignment-condition.cpp
@@ -109,6 +109,12 @@ void test() {
if ((x == 5)) {} // expected-warning {{equality comparison with extraneous parentheses}} \
// expected-note {{use '=' to turn this equality comparison into an assignment}} \
// expected-note {{remove extraneous parentheses around the comparison to silence this warning}}
+
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wparentheses-equality"
+ if ((x == 5)) {} // no-warning
+#pragma clang diagnostic pop
+
if ((5 == x)) {}
#define EQ(x,y) ((x) == (y))