summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaCXX
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2012-10-19 06:32:17 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2012-10-19 06:32:17 +0000
commitb2d6df5c955ed2ff4a4ac237f1bd7966f133b426 (patch)
tree3307ad5062dcdabcb4c72b4a5ef4214a6c2e7165 /clang/test/SemaCXX
parent09959949896f2f0ff84b557176a8c21048d13cab (diff)
downloadbcm5719-llvm-b2d6df5c955ed2ff4a4ac237f1bd7966f133b426.tar.gz
bcm5719-llvm-b2d6df5c955ed2ff4a4ac237f1bd7966f133b426.zip
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
Diffstat (limited to 'clang/test/SemaCXX')
-rw-r--r--clang/test/SemaCXX/decltype-overloaded-functions.cpp10
-rw-r--r--clang/test/SemaCXX/warn-assignment-condition.cpp6
2 files changed, 8 insertions, 8 deletions
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<typename T> 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<K> b; // expected-note{{in instantiation of template class 'S<K>' 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 <typename T>
-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<S>(); // expected-note {{in instantiation}}
+ f(S()); // expected-note {{in instantiation}}
}
}
OpenPOWER on IntegriCloud