diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/CXX/expr/expr.unary/expr.unary.op/p6.cpp | 6 | ||||
-rw-r--r-- | test/CXX/temp/temp.fct.spec/temp.arg.explicit/p3-nodeduct.cpp | 6 | ||||
-rw-r--r-- | test/SemaCXX/alignof-sizeof-reference.cpp | 6 | ||||
-rw-r--r-- | test/SemaCXX/decltype-overloaded-functions.cpp | 13 | ||||
-rw-r--r-- | test/SemaCXX/overloaded-name.cpp | 12 | ||||
-rw-r--r-- | test/SemaTemplate/resolve-single-template-id.cpp (renamed from test/SemaTemplate/resolve-single-template-id.patch) | 32 |
6 files changed, 45 insertions, 30 deletions
diff --git a/test/CXX/expr/expr.unary/expr.unary.op/p6.cpp b/test/CXX/expr/expr.unary/expr.unary.op/p6.cpp index 543a86d4e3..30f8c54919 100644 --- a/test/CXX/expr/expr.unary/expr.unary.op/p6.cpp +++ b/test/CXX/expr/expr.unary/expr.unary.op/p6.cpp @@ -29,8 +29,8 @@ bool b8 = !S(); //expected-error {{invalid argument type 'S'}} namespace PR8181 { - void f() { } - void f(char) { } - bool b = !&f; //expected-error {{cannot resolve overloaded function from context}} + void f() { } // expected-note{{candidate function}} + void f(char) { } // expected-note{{candidate function}} + bool b = !&f; //expected-error {{cannot resolve overloaded function 'f' from context}} } diff --git a/test/CXX/temp/temp.fct.spec/temp.arg.explicit/p3-nodeduct.cpp b/test/CXX/temp/temp.fct.spec/temp.arg.explicit/p3-nodeduct.cpp index 9ec8f0c90e..1140aaee6c 100644 --- a/test/CXX/temp/temp.fct.spec/temp.arg.explicit/p3-nodeduct.cpp +++ b/test/CXX/temp/temp.fct.spec/temp.arg.explicit/p3-nodeduct.cpp @@ -29,8 +29,8 @@ struct is_same<T, T> { int typeof0[is_same<__typeof__(f<int>), void (int)>::value? 1 : -1]; int typeof1[is_same<__typeof__(&f<int>), void (*)(int)>::value? 1 : -1]; -template <typename T> void g(T); -template <typename T> void g(T, T); +template <typename T> void g(T); // expected-note{{candidate function}} +template <typename T> void g(T, T); // expected-note{{candidate function}} int typeof2[is_same<__typeof__(g<float>), void (int)>::value? 1 : -1]; // \ - // expected-error{{cannot resolve overloaded function from context}} + // expected-error{{cannot resolve overloaded function 'g' from context}} diff --git a/test/SemaCXX/alignof-sizeof-reference.cpp b/test/SemaCXX/alignof-sizeof-reference.cpp index 761edfc639..b517e43cf1 100644 --- a/test/SemaCXX/alignof-sizeof-reference.cpp +++ b/test/SemaCXX/alignof-sizeof-reference.cpp @@ -8,8 +8,8 @@ void test() { static_assert(sizeof(r) == 1, "bad size"); } -void f(); -void f(int); +void f(); // expected-note{{candidate function}} +void f(int); // expected-note{{candidate function}} void g() { - sizeof(&f); // expected-error{{cannot resolve overloaded function from context}} + sizeof(&f); // expected-error{{cannot resolve overloaded function 'f' from context}} } diff --git a/test/SemaCXX/decltype-overloaded-functions.cpp b/test/SemaCXX/decltype-overloaded-functions.cpp index c11a47ecdf..f4aacd64dd 100644 --- a/test/SemaCXX/decltype-overloaded-functions.cpp +++ b/test/SemaCXX/decltype-overloaded-functions.cpp @@ -1,12 +1,15 @@ // RUN: %clang_cc1 -fsyntax-only -verify %s -std=c++0x -void f(); -void f(int); -decltype(f) a; // expected-error{{cannot resolve overloaded function from context}} +void f(); // expected-note{{candidate function}} +void f(int); // expected-note{{candidate function}} +decltype(f) a; // expected-error{{cannot resolve overloaded function 'f' from context}} template<typename T> struct S { - decltype(T::f) * f; // expected-error{{cannot resolve overloaded function from context}} + decltype(T::f) * f; // expected-error{{cannot resolve overloaded function 'f' from context}} }; -struct K { void f(); void f(int); }; +struct K { + void f(); // expected-note{{candidate function}} + void f(int); // expected-note{{candidate function}} +}; S<K> b; // expected-note{{in instantiation of template class 'S<K>' requested here}} diff --git a/test/SemaCXX/overloaded-name.cpp b/test/SemaCXX/overloaded-name.cpp index 289d5c92ec..5a87cc8e67 100644 --- a/test/SemaCXX/overloaded-name.cpp +++ b/test/SemaCXX/overloaded-name.cpp @@ -1,14 +1,14 @@ // RUN: %clang_cc1 -fsyntax-only -verify %s -int ovl(int); -float ovl(float); +int ovl(int); // expected-note 3{{candidate function}} +float ovl(float); // expected-note 3{{candidate function}} -template<typename T> T ovl(T); +template<typename T> T ovl(T); // expected-note 3{{candidate function}} void test(bool b) { - (void)((void)0, ovl); // expected-error{{cannot resolve overloaded function from context}} + (void)((void)0, ovl); // expected-error{{cannot resolve overloaded function 'ovl' from context}} // PR7863 - (void)(b? ovl : &ovl); // expected-error{{cannot resolve overloaded function from context}} - (void)(b? ovl<float> : &ovl); // expected-error{{cannot resolve overloaded function from context}} + (void)(b? ovl : &ovl); // expected-error{{cannot resolve overloaded function 'ovl' from context}} + (void)(b? ovl<float> : &ovl); // expected-error{{cannot resolve overloaded function 'ovl' from context}} (void)(b? ovl<float> : ovl<float>); } diff --git a/test/SemaTemplate/resolve-single-template-id.patch b/test/SemaTemplate/resolve-single-template-id.cpp index 8be2f6c65f..7f5d471b90 100644 --- a/test/SemaTemplate/resolve-single-template-id.patch +++ b/test/SemaTemplate/resolve-single-template-id.cpp @@ -1,11 +1,15 @@ // RUN: %clang_cc1 -fsyntax-only -verify -std=c++0x %s -//#include <typeinfo> + +namespace std { + class type_info {}; +} + void one() { } -void two() { } // expected-note 3{{candidate}} -void two(int) { } // expected-note 3{{candidate}} +void two() { } // expected-note 2{{candidate}} +void two(int) { } // expected-note 2{{candidate}} -template<class T> void twoT() { } // expected-note 4{{candidate}} -template<class T> void twoT(int) { } // expected-note 4{{candidate}} +template<class T> void twoT() { } // expected-note 3{{candidate}} +template<class T> void twoT(int) { } // expected-note 3{{candidate}} template<class T> void oneT() { } template<class T, class U> void oneT(U) { } @@ -28,15 +32,15 @@ int main() two; // expected-error {{address of overloaded}} oneT<int>; // expected-warning {{expression result unused}} twoT<int>; // expected-error {{address of overloaded}} - typeid(oneT<int>); //expected-error {{you need to include <typeinfo>}} + 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 from context}} + sizeof(twoT<int>); //expected-error {{cannot resolve overloaded function 'twoT' from context}} 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 from context}} - *twoT<int>; //expected-error {{cannot resolve overloaded function from context}} + *two; //expected-error {{cannot resolve overloaded function 'two' from context}} + *twoT<int>; //expected-error {{cannot resolve overloaded function 'twoT' from context}} !oneT<int>; // expected-warning {{expression result unused}} +oneT<int>; // expected-warning {{expression result unused}} -oneT<int>; //expected-error {{invalid argument type}} @@ -50,7 +54,7 @@ int main() (twoT<int>) == oneT<int>; //expected-error {{invalid operands to binary expression}} bool b = oneT<int>; void (*p)() = oneT<int>; - test<oneT<int>> ti; + test<oneT<int> > ti; void (*u)(int) = oneT<int>; b = (void (*)()) twoT<int>; @@ -66,3 +70,11 @@ int main() oneT<int> == 0; // expected-warning {{expression result unused}} } + +struct rdar9108698 { + template<typename> void f(); +}; + +void test_rdar9108698(rdar9108698 x) { + x.f<int>; // expected-error{{a bound member function may only be called}} +} |