diff --git a/clang/lib/AST/Decl.cpp b/clang/lib/AST/Decl.cpp --- a/clang/lib/AST/Decl.cpp +++ b/clang/lib/AST/Decl.cpp @@ -2897,7 +2897,8 @@ NamedDecl::getNameForDiagnostic(OS, Policy, Qualified); const TemplateArgumentList *TemplateArgs = getTemplateSpecializationArgs(); if (TemplateArgs) - printTemplateArgumentList(OS, TemplateArgs->asArray(), Policy); + printTemplateArgumentList(OS, TemplateArgs->asArray(), Policy, + getPrimaryTemplate()->getTemplateParameters()); } bool FunctionDecl::isVariadic() const { diff --git a/clang/test/CodeGenCXX/debug-info-simple-template-names.cpp b/clang/test/CodeGenCXX/debug-info-simple-template-names.cpp --- a/clang/test/CodeGenCXX/debug-info-simple-template-names.cpp +++ b/clang/test/CodeGenCXX/debug-info-simple-template-names.cpp @@ -78,7 +78,10 @@ // maybe it's just a question of doing APInt things to render such large // values. Punting on this for now. f2<__int128, ((__int128)9223372036854775807) * 2>(); - // CHECK: !DISubprogram(name: "f2<__int128, (__int128)18446744073709551614>", + // FIXME: This should have the cast in the non-type-template parameter value, + // for consistency with places where it's definitely needed, such as + // overloads. + // CHECK: !DISubprogram(name: "f2<__int128, 18446744073709551614>", t2().operator t1(); // FIXME: This should be something like "operator t1" diff --git a/clang/test/SemaCXX/builtin-align-cxx.cpp b/clang/test/SemaCXX/builtin-align-cxx.cpp --- a/clang/test/SemaCXX/builtin-align-cxx.cpp +++ b/clang/test/SemaCXX/builtin-align-cxx.cpp @@ -31,10 +31,10 @@ void test() { test_templated_arguments(); // fine test_templated_arguments(); - // expected-note@-1{{in instantiation of function template specialization 'test_templated_arguments'}} + // expected-note@-1{{in instantiation of function template specialization 'test_templated_arguments'}} // expected-note@-2{{forward declaration of 'fwddecl'}} test_templated_arguments(); // invalid alignment value - // expected-note@-1{{in instantiation of function template specialization 'test_templated_arguments'}} + // expected-note@-1{{in instantiation of function template specialization 'test_templated_arguments'}} } template diff --git a/clang/test/SemaCXX/matrix-type-builtins.cpp b/clang/test/SemaCXX/matrix-type-builtins.cpp --- a/clang/test/SemaCXX/matrix-type-builtins.cpp +++ b/clang/test/SemaCXX/matrix-type-builtins.cpp @@ -30,14 +30,14 @@ MyMatrix Mat2; Mat1.value = *((decltype(Mat1)::matrix_t *)Ptr1); Mat1.value = transpose(Mat1); - // expected-note@-1 {{in instantiation of function template specialization 'transpose' requested here}} + // expected-note@-1 {{in instantiation of function template specialization 'transpose' requested here}} Mat1.value = transpose(Mat2); - // expected-note@-1 {{in instantiation of function template specialization 'transpose' requested here}} + // expected-note@-1 {{in instantiation of function template specialization 'transpose' requested here}} MyMatrix Mat3; Mat3.value = transpose(Mat2); - // expected-note@-1 {{in instantiation of function template specialization 'transpose' requested here}} + // expected-note@-1 {{in instantiation of function template specialization 'transpose' requested here}} } template @@ -55,13 +55,13 @@ void test_column_major_loads_template(unsigned *Ptr1, float *Ptr2) { MyMatrix Mat1; Mat1.value = column_major_load(Mat1, Ptr1); - // expected-note@-1 {{in instantiation of function template specialization 'column_major_load' requested here}} + // expected-note@-1 {{in instantiation of function template specialization 'column_major_load' requested here}} column_major_load(Mat1, Ptr1); - // expected-note@-1 {{in instantiation of function template specialization 'column_major_load' requested here}} + // expected-note@-1 {{in instantiation of function template specialization 'column_major_load' requested here}} MyMatrix Mat2; Mat1.value = column_major_load(Mat2, Ptr2); - // expected-note@-1 {{in instantiation of function template specialization 'column_major_load' requested here}} + // expected-note@-1 {{in instantiation of function template specialization 'column_major_load' requested here}} } constexpr int constexpr1() { return 1; } @@ -116,10 +116,10 @@ void test_column_major_stores_template(MyMatrix &M1, unsigned *Ptr1, MyMatrix &M2, float *Ptr2) { column_major_store(M1, Ptr2, 10); - // expected-note@-1 {{in instantiation of function template specialization 'column_major_store' requested here}} + // expected-note@-1 {{in instantiation of function template specialization 'column_major_store' requested here}} column_major_store(M2, Ptr2); - // expected-note@-1 {{in instantiation of function template specialization 'column_major_store &, float *, 1U>' requested here}} + // expected-note@-1 {{in instantiation of function template specialization 'column_major_store &, float *, 1>' requested here}} } template @@ -139,13 +139,13 @@ void test_column_major_store_template(unsigned *Ptr1, float *Ptr2) { MyMatrix Mat1; column_major_store(Mat1, Ptr1); - // expected-note@-1 {{in instantiation of function template specialization 'column_major_store'}} + // expected-note@-1 {{in instantiation of function template specialization 'column_major_store'}} column_major_store(Mat1, Ptr2); - // expected-note@-1 {{in instantiation of function template specialization 'column_major_store'}} + // expected-note@-1 {{in instantiation of function template specialization 'column_major_store'}} MyMatrix Mat2; column_major_store(Mat2, Ptr1); - // expected-note@-1 {{in instantiation of function template specialization 'column_major_store'}} + // expected-note@-1 {{in instantiation of function template specialization 'column_major_store'}} } void test_column_major_store_constexpr(unsigned *Ptr, MyMatrix &M) { diff --git a/clang/test/SemaCXX/matrix-type-operators.cpp b/clang/test/SemaCXX/matrix-type-operators.cpp --- a/clang/test/SemaCXX/matrix-type-operators.cpp +++ b/clang/test/SemaCXX/matrix-type-operators.cpp @@ -28,13 +28,13 @@ Mat1.value = *((decltype(Mat1)::matrix_t *)Ptr1); unsigned v1 = add(Mat1, Mat1); // expected-error@-1 {{cannot initialize a variable of type 'unsigned int' with an rvalue of type 'typename MyMatrix::matrix_t' (aka 'unsigned int __attribute__((matrix_type(2, 2)))')}} - // expected-note@-2 {{in instantiation of function template specialization 'add' requested here}} + // expected-note@-2 {{in instantiation of function template specialization 'add' requested here}} Mat1.value = add(Mat1, Mat2); - // expected-note@-1 {{in instantiation of function template specialization 'add' requested here}} + // expected-note@-1 {{in instantiation of function template specialization 'add' requested here}} Mat1.value = add(Mat2, Mat3); - // expected-note@-1 {{in instantiation of function template specialization 'add' requested here}} + // expected-note@-1 {{in instantiation of function template specialization 'add' requested here}} } template @@ -56,13 +56,13 @@ Mat1.value = *((decltype(Mat1)::matrix_t *)Ptr1); unsigned v1 = subtract(Mat1, Mat1); // expected-error@-1 {{cannot initialize a variable of type 'unsigned int' with an rvalue of type 'typename MyMatrix::matrix_t' (aka 'unsigned int __attribute__((matrix_type(2, 2)))')}} - // expected-note@-2 {{in instantiation of function template specialization 'subtract' requested here}} + // expected-note@-2 {{in instantiation of function template specialization 'subtract' requested here}} Mat1.value = subtract(Mat1, Mat2); - // expected-note@-1 {{in instantiation of function template specialization 'subtract' requested here}} + // expected-note@-1 {{in instantiation of function template specialization 'subtract' requested here}} Mat1.value = subtract(Mat2, Mat3); - // expected-note@-1 {{in instantiation of function template specialization 'subtract' requested here}} + // expected-note@-1 {{in instantiation of function template specialization 'subtract' requested here}} } template @@ -89,15 +89,15 @@ MyMatrix Mat3; Mat1.value = *((decltype(Mat1)::matrix_t *)Ptr1); unsigned v1 = multiply(Mat1, Mat1); - // expected-note@-1 {{in instantiation of function template specialization 'multiply' requested here}} + // expected-note@-1 {{in instantiation of function template specialization 'multiply' requested here}} // expected-error@-2 {{cannot initialize a variable of type 'unsigned int' with an rvalue of type 'typename MyMatrix::matrix_t' (aka 'unsigned int __attribute__((matrix_type(2, 2)))')}} MyMatrix Mat4; Mat1.value = multiply(Mat4, Mat2); - // expected-note@-1 {{in instantiation of function template specialization 'multiply' requested here}} + // expected-note@-1 {{in instantiation of function template specialization 'multiply' requested here}} Mat1.value = multiply(Mat3, Mat1); - // expected-note@-1 {{in instantiation of function template specialization 'multiply' requested here}} + // expected-note@-1 {{in instantiation of function template specialization 'multiply' requested here}} Mat4.value = Mat4.value * Mat1; // expected-error@-1 {{no viable conversion from 'MyMatrix' to 'unsigned int'}} diff --git a/clang/test/SemaTemplate/address_space-dependent.cpp b/clang/test/SemaTemplate/address_space-dependent.cpp --- a/clang/test/SemaTemplate/address_space-dependent.cpp +++ b/clang/test/SemaTemplate/address_space-dependent.cpp @@ -102,7 +102,7 @@ HasASTemplateFields<1> HASTF; neg<-1>(); // expected-note {{in instantiation of function template specialization 'neg<-1>' requested here}} correct<0x7FFFEB>(); - tooBig<8388650>(); // expected-note {{in instantiation of function template specialization 'tooBig<8388650L>' requested here}} + tooBig<8388650>(); // expected-note {{in instantiation of function template specialization 'tooBig<8388650>' requested here}} __attribute__((address_space(1))) char *x; __attribute__((address_space(2))) char *y; diff --git a/clang/test/SemaTemplate/delegating-constructors.cpp b/clang/test/SemaTemplate/delegating-constructors.cpp --- a/clang/test/SemaTemplate/delegating-constructors.cpp +++ b/clang/test/SemaTemplate/delegating-constructors.cpp @@ -9,7 +9,7 @@ public: template string(const char (&str)[N]) - : string(str) {} // expected-error{{constructor for 'string<6U>' creates a delegation cycle}} + : string(str) {} // expected-error{{constructor for 'string<6>' creates a delegation cycle}} }; void f() { diff --git a/clang/test/SemaTemplate/matrix-type.cpp b/clang/test/SemaTemplate/matrix-type.cpp --- a/clang/test/SemaTemplate/matrix-type.cpp +++ b/clang/test/SemaTemplate/matrix-type.cpp @@ -17,7 +17,7 @@ void instantiate_template_3() { matrix_template_3<1, 10>(); - matrix_template_3<0, 10>(); // expected-note{{in instantiation of function template specialization 'matrix_template_3<0U, 10U>' requested here}} + matrix_template_3<0, 10>(); // expected-note{{in instantiation of function template specialization 'matrix_template_3<0, 10>' requested here}} } template @@ -27,7 +27,7 @@ void instantiate_template_4() { matrix_template_4<2, 10>(); - matrix_template_4<-3, 10>(); // expected-note{{in instantiation of function template specialization 'matrix_template_4<-3, 10U>' requested here}} + matrix_template_4<-3, 10>(); // expected-note{{in instantiation of function template specialization 'matrix_template_4<-3, 10>' requested here}} } template