Warn for "if ((a == b))" where the equality expression is needlessly wrapped inside parentheses.
It's highly likely that the user intended an assignment used as condition.
Addresses rdar://8848646.
llvm-svn: 124668
diff --git a/clang/test/SemaCXX/warn-assignment-condition.cpp b/clang/test/SemaCXX/warn-assignment-condition.cpp
index 9dcffbf..48cc137 100644
--- a/clang/test/SemaCXX/warn-assignment-condition.cpp
+++ b/clang/test/SemaCXX/warn-assignment-condition.cpp
@@ -105,4 +105,8 @@
if (a |= b) {} // expected-warning {{using the result of an assignment as a condition without parentheses}} \
// expected-note{{use '!=' to turn this compound assignment into an inequality comparison}} \
// expected-note{{place parentheses around the assignment to silence this warning}}
+
+ 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}}
}