summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaCXX
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test/SemaCXX')
-rw-r--r--clang/test/SemaCXX/addr-of-overloaded-function-casting.cpp8
-rw-r--r--clang/test/SemaCXX/cxx1y-deduced-return-type.cpp15
2 files changed, 16 insertions, 7 deletions
diff --git a/clang/test/SemaCXX/addr-of-overloaded-function-casting.cpp b/clang/test/SemaCXX/addr-of-overloaded-function-casting.cpp
index cfd55eed81d..8698736b3ae 100644
--- a/clang/test/SemaCXX/addr-of-overloaded-function-casting.cpp
+++ b/clang/test/SemaCXX/addr-of-overloaded-function-casting.cpp
@@ -4,8 +4,12 @@ void g();
void f(); // expected-note 9{{candidate function}}
void f(int); // expected-note 9{{candidate function}}
-template<class T> void t(T); // expected-note 6{{candidate function}}
-template<class T> void t(T*); // expected-note 6{{candidate function}}
+template <class T>
+void t(T); // expected-note 6{{candidate function}} \
+ // expected-note 3{{candidate template ignored: could not match 'void' against 'int'}}
+template <class T>
+void t(T *); // expected-note 6{{candidate function}} \
+ // expected-note 3{{candidate template ignored: could not match 'void' against 'int'}}
template<class T> void u(T);
diff --git a/clang/test/SemaCXX/cxx1y-deduced-return-type.cpp b/clang/test/SemaCXX/cxx1y-deduced-return-type.cpp
index d3067eb411c..743ef4fbf2b 100644
--- a/clang/test/SemaCXX/cxx1y-deduced-return-type.cpp
+++ b/clang/test/SemaCXX/cxx1y-deduced-return-type.cpp
@@ -112,7 +112,8 @@ namespace Templates {
int e = fwd_decl<int>(); // expected-error {{cannot be used before it is defined}}
template<typename T> auto fwd_decl() { return 0; }
int f = fwd_decl<int>();
- template<typename T> auto fwd_decl();
+ template <typename T>
+ auto fwd_decl(); // expected-note {{candidate template ignored: could not match 'auto ()' against 'int ()'}}
int g = fwd_decl<char>();
auto (*p)() = f1; // expected-error {{incompatible initializer}}
@@ -126,7 +127,8 @@ namespace Templates {
extern template int fwd_decl<char>(); // expected-error {{does not refer to a function template}}
int k2 = fwd_decl<char>();
- template<typename T> auto instantiate() { T::error; } // expected-error {{has no members}}
+ template <typename T> auto instantiate() { T::error; } // expected-error {{has no members}} \
+ // expected-note {{candidate template ignored: could not match 'auto ()' against 'void ()'}}
extern template auto instantiate<int>(); // ok
int k = instantiate<int>(); // expected-note {{in instantiation of}}
template<> auto instantiate<char>() {} // ok
@@ -157,7 +159,8 @@ namespace Templates {
double &mem_check4 = take_fn<double>(Outer<double>::arg_multi);
namespace Deduce1 {
- template<typename T> auto f() { return 0; } // expected-note {{candidate}}
+ template <typename T> auto f() { return 0; } // expected-note {{candidate}} \
+ // expected-note {{candidate function has different return type ('int' expected but has 'auto')}}
template<typename T> void g(T(*)()); // expected-note 2{{candidate}}
void h() {
auto p = f<int>;
@@ -170,7 +173,8 @@ namespace Templates {
}
namespace Deduce2 {
- template<typename T> auto f(int) { return 0; } // expected-note {{candidate}}
+ template <typename T> auto f(int) { return 0; } // expected-note {{candidate}} \
+ // expected-note {{candidate function has different return type ('int' expected but has 'auto')}}
template<typename T> void g(T(*)(int)); // expected-note 2{{candidate}}
void h() {
auto p = f<int>;
@@ -322,7 +326,8 @@ namespace Redecl {
int f(); // expected-error {{functions that differ only in their return type cannot be overloaded}}
decltype(auto) f(); // expected-error {{cannot be overloaded}}
- template<typename T> auto g(T t) { return t; } // expected-note {{candidate}}
+ template <typename T> auto g(T t) { return t; } // expected-note {{candidate}} \
+ // expected-note {{candidate function [with T = int]}}
template auto g(int);
template char g(char); // expected-error {{does not refer to a function}}
template<> auto g(double);
OpenPOWER on IntegriCloud