diff options
Diffstat (limited to 'test/CXX/temp/temp.fct.spec/temp.deduct/temp.deduct.call/basic.cpp')
-rw-r--r-- | test/CXX/temp/temp.fct.spec/temp.deduct/temp.deduct.call/basic.cpp | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/test/CXX/temp/temp.fct.spec/temp.deduct/temp.deduct.call/basic.cpp b/test/CXX/temp/temp.fct.spec/temp.deduct/temp.deduct.call/basic.cpp index 90d2949..33efac0 100644 --- a/test/CXX/temp/temp.fct.spec/temp.deduct/temp.deduct.call/basic.cpp +++ b/test/CXX/temp/temp.fct.spec/temp.deduct/temp.deduct.call/basic.cpp @@ -15,8 +15,7 @@ void test_f1(int *ip, float fv) { f1(ip, fv); } -// TODO: this diagnostic can and should improve -template<typename T> void f2(T*, T*); // expected-note {{candidate template ignored: failed template argument deduction}} \ +template<typename T> void f2(T*, T*); // expected-note {{candidate template ignored: could not match 'T *' against 'ConvToIntPtr'}} \ // expected-note{{candidate template ignored: deduced conflicting types for parameter 'T' ('int' vs. 'float')}} struct ConvToIntPtr { @@ -28,3 +27,21 @@ void test_f2(int *ip, float *fp) { f2(ip, ip); // okay f2(ip, fp); // expected-error{{no matching function}} } + +namespace test3 { + template<typename T> + struct bar { }; + + template<typename T> + struct foo { + operator bar<T>(); + }; + + template<typename T> + void func(bar<T>) { // expected-note {{candidate template ignored: could not match 'bar' against 'foo'}} + } + + void test() { + func(foo<int>()); // expected-error {{no matching function}} + } +} |