summaryrefslogtreecommitdiff
path: root/test/SemaTemplate/resolve-single-template-id.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/SemaTemplate/resolve-single-template-id.cpp')
-rw-r--r--test/SemaTemplate/resolve-single-template-id.cpp38
1 files changed, 20 insertions, 18 deletions
diff --git a/test/SemaTemplate/resolve-single-template-id.cpp b/test/SemaTemplate/resolve-single-template-id.cpp
index ef0a763076703..b9833d8609ef3 100644
--- a/test/SemaTemplate/resolve-single-template-id.cpp
+++ b/test/SemaTemplate/resolve-single-template-id.cpp
@@ -1,15 +1,15 @@
-// RUN: %clang_cc1 -fsyntax-only -verify -std=c++0x %s
+// RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s
namespace std {
class type_info {};
}
void one() { }
-void two() { } // expected-note 3{{candidate}}
-void two(int) { } // expected-note 3{{candidate}}
+void two() { } // expected-note 4{{possible target for call}}
+void two(int) { } // expected-note 4{{possible target for call}}
-template<class T> void twoT() { } // expected-note 5{{candidate}}
-template<class T> void twoT(int) { } // expected-note 5{{candidate}}
+template<class T> void twoT() { } // expected-note 5{{possible target for call}}
+template<class T> void twoT(int) { } // expected-note 5{{possible target for call}}
template<class T> void oneT() { }
template<class T, class U> void oneT(U) { }
@@ -29,29 +29,30 @@ template<void (*p)(int)> struct test { };
int main()
{
one; // expected-warning {{expression result unused}}
- two; // expected-error {{cannot resolve overloaded function 'two' from context}}
+ two; // expected-error {{reference to overloaded function could not be resolved; did you mean to call it with no arguments?}}
oneT<int>; // expected-warning {{expression result unused}}
- twoT<int>; // expected-error {{cannot resolve overloaded function 'twoT' from context}}
+ twoT<int>; // expected-error {{reference to overloaded function could not be resolved; did you mean to call it?}}
typeid(oneT<int>); // expected-warning{{expression result unused}}
sizeof(oneT<int>); // expected-warning {{expression result unused}}
- sizeof(twoT<int>); //expected-error {{cannot resolve overloaded function 'twoT' from context}}
+ sizeof(twoT<int>); //expected-error {{reference to overloaded function could not be resolved; did you mean to call it?}}
decltype(oneT<int>)* fun = 0;
*one; // expected-warning {{expression result unused}}
*oneT<int>; // expected-warning {{expression result unused}}
- *two; //expected-error {{cannot resolve overloaded function 'two' from context}}
- *twoT<int>; //expected-error {{cannot resolve overloaded function 'twoT' from context}}
+ *two; //expected-error {{reference to overloaded function could not be resolved; did you mean to call it with no arguments?}} expected-error {{indirection requires pointer operand}}
+ *twoT<int>; //expected-error {{reference to overloaded function could not be resolved; did you mean to call it?}}
!oneT<int>; // expected-warning {{expression result unused}}
+oneT<int>; // expected-warning {{expression result unused}}
-oneT<int>; //expected-error {{invalid argument type}}
- oneT<int> == 0; // expected-warning {{expression result unused}}
- 0 == oneT<int>; // expected-warning {{expression result unused}}
- 0 != oneT<int>; // expected-warning {{expression result unused}}
+ oneT<int> == 0; // expected-warning {{equality comparison result unused}} \
+ // expected-note {{use '=' to turn this equality comparison into an assignment}}
+ 0 == oneT<int>; // expected-warning {{equality comparison result unused}}
+ 0 != oneT<int>; // expected-warning {{inequality comparison result unused}}
(false ? one : oneT<int>); // expected-warning {{expression result unused}}
void (*p1)(int); p1 = oneT<int>;
int i = (int) (false ? (void (*)(int))twoT<int> : oneT<int>); //expected-error {{incompatible operand}}
- (twoT<int>) == oneT<int>; //expected-error {{cannot resolve overloaded function 'twoT' from context}}
+ (twoT<int>) == oneT<int>; //expected-error {{reference to overloaded function could not be resolved; did you mean to call it?}} {{cannot resolve overloaded function 'twoT' from context}}
bool b = oneT<int>;
void (*p)() = oneT<int>;
test<oneT<int> > ti;
@@ -65,9 +66,10 @@ int main()
oneT<int> < oneT<int>; //expected-warning {{self-comparison always evaluates to false}} \
//expected-warning {{expression result unused}}
- two < two; //expected-error {{cannot resolve overloaded function 'two' from context}}
- twoT<int> < twoT<int>; //expected-error {{cannot resolve overloaded function 'twoT' from context}}
- oneT<int> == 0; // expected-warning {{expression result unused}}
+ two < two; //expected-error 2 {{reference to overloaded function could not be resolved; did you mean to call it with no arguments?}} expected-error {{invalid operands to binary expression ('void' and 'void')}}
+ twoT<int> < twoT<int>; //expected-error {{reference to overloaded function could not be resolved; did you mean to call it?}} {{cannot resolve overloaded function 'twoT' from context}}
+ oneT<int> == 0; // expected-warning {{equality comparison result unused}} \
+ // expected-note {{use '=' to turn this equality comparison into an assignment}}
}
@@ -76,5 +78,5 @@ struct rdar9108698 {
};
void test_rdar9108698(rdar9108698 x) {
- x.f<int>; // expected-error{{a bound member function may only be called}}
+ x.f<int>; // expected-error{{reference to non-static member function must be called}}
}