diff options
author | Larisse Voufo <lvoufo@google.com> | 2013-07-19 23:00:19 +0000 |
---|---|---|
committer | Larisse Voufo <lvoufo@google.com> | 2013-07-19 23:00:19 +0000 |
commit | 4384712b3a0aedd7c68d6abdb0407850f7b46c8b (patch) | |
tree | 289062be6437f8027bc6cb742333256f251e0171 /test/SemaTemplate | |
parent | 8c5d4078bb40642847164e7613828262d32db973 (diff) | |
download | clang-4384712b3a0aedd7c68d6abdb0407850f7b46c8b.tar.gz |
FIXME fix: improving diagnostics for template arguments deduction of class templates and explicit specializations
This patch essentially removes all the FIXMEs following calls to DeduceTemplateArguments() that want to keep track of deduction failure info.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186730 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaTemplate')
-rw-r--r-- | test/SemaTemplate/alias-templates.cpp | 7 | ||||
-rw-r--r-- | test/SemaTemplate/explicit-instantiation.cpp | 15 | ||||
-rw-r--r-- | test/SemaTemplate/function-template-specialization.cpp | 3 |
3 files changed, 10 insertions, 15 deletions
diff --git a/test/SemaTemplate/alias-templates.cpp b/test/SemaTemplate/alias-templates.cpp index f495620b54..eeb6b95189 100644 --- a/test/SemaTemplate/alias-templates.cpp +++ b/test/SemaTemplate/alias-templates.cpp @@ -189,10 +189,3 @@ namespace PR16646 { } } } - -namespace VariadicAliasWithFunctionType { - template <class T> struct A { }; - template <class ...Args> using B = A<int(Args ...x)>; - template <class ...Args> void f(B<A<int>, A<Args>...>) {} - void g() { f(A<int(A<int>,A<int>)>()); } -} diff --git a/test/SemaTemplate/explicit-instantiation.cpp b/test/SemaTemplate/explicit-instantiation.cpp index e3e77d0828..04a863bdc1 100644 --- a/test/SemaTemplate/explicit-instantiation.cpp +++ b/test/SemaTemplate/explicit-instantiation.cpp @@ -15,9 +15,9 @@ struct X0 { return x + 1; // expected-error{{invalid operands}} } T* f0(T*, T*) { return T(); } // expected-warning{{expression which evaluates to zero treated as a null pointer constant of type 'int *'}} - - template<typename U> - T f0(T, U) { return T(); } + + template <typename U> T f0(T, U) { return T(); } // expected-note {{candidate template ignored: could not match 'int (int, U)' against 'int (int) const'}} \ + // expected-note {{candidate template ignored: could not match 'int' against 'int *'}} }; template<typename T> @@ -59,13 +59,14 @@ template int *X2::f1(int *); // okay template void X2::f2(int *, int *); // expected-error{{ambiguous}} - -template<typename T> void print_type() { } +template <typename T> +void print_type() {} // expected-note {{candidate template ignored: could not match 'void ()' against 'void (float *)'}} template void print_type<int>(); template void print_type<float>(); -template<typename T> void print_type(T*) { } +template <typename T> +void print_type(T *) {} // expected-note {{candidate template ignored: could not match 'void (int *)' against 'void (float *)'}} template void print_type(int*); template void print_type<int>(float*); // expected-error{{does not refer}} @@ -94,7 +95,7 @@ namespace PR7622 { template<typename,typename> struct basic_streambuf{friend bob<>()}; // expected-error{{unknown type name 'bob'}} \ - // expected-error{{expected member name or ';' after declaration specifiers}} + // expected-error{{expected member name or ';' after declaration specifiers}} template struct basic_streambuf<int>; } diff --git a/test/SemaTemplate/function-template-specialization.cpp b/test/SemaTemplate/function-template-specialization.cpp index 2338b6701c..6327ff64c3 100644 --- a/test/SemaTemplate/function-template-specialization.cpp +++ b/test/SemaTemplate/function-template-specialization.cpp @@ -1,6 +1,7 @@ // RUN: %clang_cc1 -fsyntax-only -verify %s -template<int N> void f0(int (&array)[N]); +template <int N> +void f0(int (&array)[N]); // expected-note {{candidate template ignored: could not match 'int' against 'char'}} // Simple function template specialization (using overloading) template<> void f0(int (&array)[1]); |