aboutsummaryrefslogtreecommitdiff
path: root/test/SemaCXX/warn-assignment-condition.cpp
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2011-03-28 23:52:04 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2011-03-28 23:52:04 +0000
commit170a6a229b6cb0c411be5edaa587a1b1436bd147 (patch)
treefc55e09f144a70a59f606106b435efe3d58b3f4a /test/SemaCXX/warn-assignment-condition.cpp
parent14086764e340267e17803d0f8243070ffae2c76e (diff)
Don't do the checks of Sema::DiagnoseEqualityWithExtraParens() on type-dependent expressions. Fixes rdar://9027658.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128437 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaCXX/warn-assignment-condition.cpp')
-rw-r--r--test/SemaCXX/warn-assignment-condition.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/SemaCXX/warn-assignment-condition.cpp b/test/SemaCXX/warn-assignment-condition.cpp
index 27eedb9128..c0ef35b252 100644
--- a/test/SemaCXX/warn-assignment-condition.cpp
+++ b/test/SemaCXX/warn-assignment-condition.cpp
@@ -125,3 +125,16 @@ void test2() {
if ((test2 == fn)) {}
}
+namespace rdar9027658 {
+template <typename T>
+void f() {
+ if ((T::g == 3)) { } // 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}}
+}
+
+struct S { int g; };
+void test() {
+ f<S>(); // expected-note {{in instantiation}}
+}
+}