From b2d6df5c955ed2ff4a4ac237f1bd7966f133b426 Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Fri, 19 Oct 2012 06:32:17 +0000 Subject: PR14124: When performing template instantiation of a qualified-id outside of a class, diagnose if the qualified-id instantiates to a non-static class member. llvm-svn: 166268 --- clang/test/SemaCXX/decltype-overloaded-functions.cpp | 10 +++++----- clang/test/SemaCXX/warn-assignment-condition.cpp | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'clang/test/SemaCXX') diff --git a/clang/test/SemaCXX/decltype-overloaded-functions.cpp b/clang/test/SemaCXX/decltype-overloaded-functions.cpp index 2ed4465b5b9..c1d01fc9af9 100644 --- a/clang/test/SemaCXX/decltype-overloaded-functions.cpp +++ b/clang/test/SemaCXX/decltype-overloaded-functions.cpp @@ -1,16 +1,16 @@ // RUN: %clang_cc1 -fsyntax-only -verify %s -std=c++11 -void f(); // expected-note{{possible target for call}} -void f(int); // expected-note{{possible target for call}} +void f(); // expected-note{{possible target for call}} +void f(int); // expected-note{{possible target for call}} decltype(f) a; // expected-error{{reference to overloaded function could not be resolved; did you mean to call it with no arguments?}} expected-error {{variable has incomplete type 'decltype(f())' (aka 'void')}} template struct S { - decltype(T::f) * f; // expected-error{{reference to overloaded function could not be resolved; did you mean to call it with no arguments?}} expected-error {{call to non-static member function without an object argument}} + decltype(T::f) * f; // expected-error {{call to non-static member function without an object argument}} }; struct K { - void f(); // expected-note{{possible target for call}} - void f(int); // expected-note{{possible target for call}} + void f(); + void f(int); }; S b; // expected-note{{in instantiation of template class 'S' requested here}} diff --git a/clang/test/SemaCXX/warn-assignment-condition.cpp b/clang/test/SemaCXX/warn-assignment-condition.cpp index 04f2e795254..09084e36bb4 100644 --- a/clang/test/SemaCXX/warn-assignment-condition.cpp +++ b/clang/test/SemaCXX/warn-assignment-condition.cpp @@ -133,14 +133,14 @@ void test2() { namespace rdar9027658 { template -void f() { - if ((T::g == 3)) { } // expected-warning {{equality comparison with extraneous parentheses}} \ +void f(T t) { + 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(); // expected-note {{in instantiation}} + f(S()); // expected-note {{in instantiation}} } } -- cgit v1.2.3