Author: Sam McCall Date: 2020-03-26T09:53:54+01:00 New Revision: 159a9f7e76307734bcdcae3357640e42e0733194
URL: https://github.com/llvm/llvm-project/commit/159a9f7e76307734bcdcae3357640e42e0733194 DIFF: https://github.com/llvm/llvm-project/commit/159a9f7e76307734bcdcae3357640e42e0733194.diff LOG: [AST] Print a<b<c>> without extra spaces in C++11 or later. Summary: It's not 1998 anymore. Reviewers: kadircet Subscribers: jkorous, arphaman, usaxena95, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D76801 Added: Modified: clang-tools-extra/clangd/unittests/HoverTests.cpp clang-tools-extra/test/clang-tidy/checkers/modernize-use-using.cpp clang/include/clang/AST/PrettyPrinter.h clang/lib/AST/TypePrinter.cpp clang/test/CXX/expr/expr.prim/expr.prim.req/type-requirement.cpp clang/test/CXX/temp/temp.arg/temp.arg.template/p3-0x.cpp clang/test/CodeGenCXX/debug-info-template-explicit-specialization.cpp clang/test/Misc/diag-aka-types.cpp clang/test/Modules/ExtDebugInfo.cpp clang/test/Modules/ModuleDebugInfo.cpp clang/test/OpenMP/distribute_parallel_for_private_messages.cpp clang/test/OpenMP/distribute_parallel_for_simd_private_messages.cpp clang/test/OpenMP/distribute_simd_private_messages.cpp clang/test/OpenMP/for_private_messages.cpp clang/test/OpenMP/for_simd_private_messages.cpp clang/test/OpenMP/master_taskloop_private_messages.cpp clang/test/OpenMP/master_taskloop_simd_private_messages.cpp clang/test/OpenMP/parallel_for_private_messages.cpp clang/test/OpenMP/parallel_for_simd_private_messages.cpp clang/test/OpenMP/parallel_master_private_messages.cpp clang/test/OpenMP/parallel_master_taskloop_private_messages.cpp clang/test/OpenMP/parallel_master_taskloop_simd_private_messages.cpp clang/test/OpenMP/parallel_sections_private_messages.cpp clang/test/OpenMP/sections_private_messages.cpp clang/test/OpenMP/simd_private_messages.cpp clang/test/OpenMP/single_private_messages.cpp clang/test/OpenMP/target_firstprivate_messages.cpp clang/test/OpenMP/target_parallel_for_private_messages.cpp clang/test/OpenMP/target_parallel_for_simd_private_messages.cpp clang/test/OpenMP/target_private_messages.cpp clang/test/OpenMP/target_simd_private_messages.cpp clang/test/OpenMP/taskloop_private_messages.cpp clang/test/OpenMP/taskloop_simd_private_messages.cpp clang/test/SemaTemplate/instantiate-member-expr.cpp clang/unittests/AST/DeclPrinterTest.cpp Removed: ################################################################################ diff --git a/clang-tools-extra/clangd/unittests/HoverTests.cpp b/clang-tools-extra/clangd/unittests/HoverTests.cpp index 593fb16e2194..99fd1c572447 100644 --- a/clang-tools-extra/clangd/unittests/HoverTests.cpp +++ b/clang-tools-extra/clangd/unittests/HoverTests.cpp @@ -1567,7 +1567,7 @@ TEST(Hover, All) { HI.Kind = index::SymbolKind::Variable; HI.NamespaceScope = ""; HI.Name = "foo"; - HI.Type = "cls<cls<cls<int> > >"; + HI.Type = "cls<cls<cls<int>>>"; HI.Value = "{}"; }}, { @@ -1579,7 +1579,7 @@ TEST(Hover, All) { HI.Definition = "template <> struct cls<cls<cls<int>>> {}"; HI.Kind = index::SymbolKind::Struct; HI.NamespaceScope = ""; - HI.Name = "cls<cls<cls<int> > >"; + HI.Name = "cls<cls<cls<int>>>"; HI.Documentation = "type of nested templates."; }}, { diff --git a/clang-tools-extra/test/clang-tidy/checkers/modernize-use-using.cpp b/clang-tools-extra/test/clang-tidy/checkers/modernize-use-using.cpp index eb3316a4a04e..2eccc9066fa6 100644 --- a/clang-tools-extra/test/clang-tidy/checkers/modernize-use-using.cpp +++ b/clang-tools-extra/test/clang-tidy/checkers/modernize-use-using.cpp @@ -247,19 +247,19 @@ typedef Q<T{0 < 0}.b> Q3_t; typedef TwoArgTemplate<TwoArgTemplate<int, Q<T{0 < 0}.b> >, S<(0 < 0), Q<b[0 < 0]> > > Nested_t; // CHECK-MESSAGES: :[[@LINE-1]]:1: warning: use 'using' instead of 'typedef' -// CHECK-FIXES: using Nested_t = TwoArgTemplate<TwoArgTemplate<int, Q<T{0 < 0}.b> >, S<(0 < 0), Q<b[0 < 0]> > >; +// CHECK-FIXES: using Nested_t = TwoArgTemplate<TwoArgTemplate<int, Q<T{0 < 0}.b>>, S<(0 < 0), Q<b[0 < 0]>>>; template <typename... Args> class Variadic {}; typedef Variadic<Variadic<int, bool, Q<T{0 < 0}.b> >, S<(0 < 0), Variadic<Q<b[0 < 0]> > > > Variadic_t; // CHECK-MESSAGES: :[[@LINE-1]]:1: warning: use 'using' instead of 'typedef' -// CHECK-FIXES: using Variadic_t = Variadic<Variadic<int, bool, Q<T{0 < 0}.b> >, S<(0 < 0), Variadic<Q<b[0 < 0]> > > > +// CHECK-FIXES: using Variadic_t = Variadic<Variadic<int, bool, Q<T{0 < 0}.b>>, S<(0 < 0), Variadic<Q<b[0 < 0]>>>> typedef Variadic<Variadic<int, bool, Q<T{0 < 0}.b> >, S<(0 < 0), Variadic<Q<b[0 < 0]> > > > Variadic_t, *Variadic_p; // CHECK-MESSAGES: :[[@LINE-1]]:1: warning: use 'using' instead of 'typedef' // CHECK-MESSAGES: :[[@LINE-2]]:103: warning: use 'using' instead of 'typedef' -// CHECK-FIXES: using Variadic_t = Variadic<Variadic<int, bool, Q<T{0 < 0}.b> >, S<(0 < 0), Variadic<Q<b[0 < 0]> > > >; +// CHECK-FIXES: using Variadic_t = Variadic<Variadic<int, bool, Q<T{0 < 0}.b>>, S<(0 < 0), Variadic<Q<b[0 < 0]>>>>; // CHECK-FIXES-NEXT: using Variadic_p = Variadic_t*; typedef struct { int a; } R_t, *R_p; diff --git a/clang/include/clang/AST/PrettyPrinter.h b/clang/include/clang/AST/PrettyPrinter.h index bbac93029c48..f42a6c0c1442 100644 --- a/clang/include/clang/AST/PrettyPrinter.h +++ b/clang/include/clang/AST/PrettyPrinter.h @@ -57,7 +57,8 @@ struct PrintingPolicy { SuppressLifetimeQualifiers(false), SuppressTemplateArgsInCXXConstructors(false), Bool(LO.Bool), Restrict(LO.C99), Alignof(LO.CPlusPlus11), UnderscoreAlignof(LO.C11), - UseVoidForZeroParams(!LO.CPlusPlus), TerseOutput(false), + UseVoidForZeroParams(!LO.CPlusPlus), + SplitTemplateClosers(!LO.CPlusPlus11), TerseOutput(false), PolishForDeclaration(false), Half(LO.Half), MSWChar(LO.MicrosoftExt && !LO.WChar), IncludeNewlines(true), MSVCFormatting(false), ConstantsAsWritten(false), @@ -183,6 +184,9 @@ struct PrintingPolicy { /// with zero parameters. unsigned UseVoidForZeroParams : 1; + /// Whether nested templates must be closed like a<b<c> > rather than a<b<c>>. + unsigned SplitTemplateClosers : 1; + /// Provide a 'terse' output. /// /// For example, in this mode we don't print function bodies, class members, diff --git a/clang/lib/AST/TypePrinter.cpp b/clang/lib/AST/TypePrinter.cpp index 824c9a611876..405a760c58ce 100644 --- a/clang/lib/AST/TypePrinter.cpp +++ b/clang/lib/AST/TypePrinter.cpp @@ -1722,13 +1722,13 @@ static void printTo(raw_ostream &OS, ArrayRef<TA> Args, OS << ArgString; - NeedSpace = (!ArgString.empty() && ArgString.back() == '>'); + // If the last character of our string is '>', add another space to + // keep the two '>''s separate tokens. + NeedSpace = Policy.SplitTemplateClosers && !ArgString.empty() && + ArgString.back() == '>'; FirstArg = false; } - // If the last character of our string is '>', add another space to - // keep the two '>''s separate tokens. We don't *have* to do this in - // C++0x, but it's still good hygiene. if (NeedSpace) OS << ' '; diff --git a/clang/test/CXX/expr/expr.prim/expr.prim.req/type-requirement.cpp b/clang/test/CXX/expr/expr.prim/expr.prim.req/type-requirement.cpp index 71c87ffff8bc..b8903b884e0a 100644 --- a/clang/test/CXX/expr/expr.prim/expr.prim.req/type-requirement.cpp +++ b/clang/test/CXX/expr/expr.prim/expr.prim.req/type-requirement.cpp @@ -63,7 +63,7 @@ template<typename T> struct invalid { typename T::type x; }; // expected-error@-1 {{typename specifier refers to non-type member 'type' in 'D'}} using r1i5 = r1<invalid<D>>; // expected-error@-1 {{constraints not satisfied for class template 'r1' [with T = invalid<D>]}} -// expected-note@-2 {{while checking constraint satisfaction for template 'r1<invalid<D> >' required here}} +// expected-note@-2 {{while checking constraint satisfaction for template 'r1<invalid<D>>' required here}} // mismatching template arguments @@ -191,4 +191,4 @@ namespace std_example { using c2 = C1_check<has_type>; // expected-error{{constraints not satisfied for class template 'C1_check' [with T = std_example::has_type]}} using c3 = C2_check<has_inner>; // expected-error{{constraints not satisfied for class template 'C2_check' [with T = std_example::has_inner]}} using c4 = C3_check<void>; // expected-error{{constraints not satisfied for class template 'C3_check' [with T = void]}} -} \ No newline at end of file +} diff --git a/clang/test/CXX/temp/temp.arg/temp.arg.template/p3-0x.cpp b/clang/test/CXX/temp/temp.arg/temp.arg.template/p3-0x.cpp index 1c13bffa212f..0c555b53f95e 100644 --- a/clang/test/CXX/temp/temp.arg/temp.arg.template/p3-0x.cpp +++ b/clang/test/CXX/temp/temp.arg/temp.arg.template/p3-0x.cpp @@ -13,9 +13,9 @@ template <class T1, class T2, int N = 17> struct E; eval<A<int>> eA; eval<B<int, float>> eB; -eval<C<17>> eC; // expected-error{{implicit instantiation of undefined template 'eval<C<17> >'}} -eval<D<int, 17>> eD; // expected-error{{implicit instantiation of undefined template 'eval<D<int, 17> >'}} -eval<E<int, float>> eE; // expected-error{{implicit instantiation of undefined template 'eval<E<int, float, 17> >}} +eval<C<17>> eC; // expected-error{{implicit instantiation of undefined template 'eval<C<17>>'}} +eval<D<int, 17>> eD; // expected-error{{implicit instantiation of undefined template 'eval<D<int, 17>>'}} +eval<E<int, float>> eE; // expected-error{{implicit instantiation of undefined template 'eval<E<int, float, 17>>}} template<template <int ...N> class TT> struct X0 { }; // expected-note{{previous non-type template parameter with type 'int' is here}} template<int I, int J, int ...Rest> struct X0a; diff --git a/clang/test/CodeGenCXX/debug-info-template-explicit-specialization.cpp b/clang/test/CodeGenCXX/debug-info-template-explicit-specialization.cpp index 4e41c4092bf4..d97d82b76965 100644 --- a/clang/test/CodeGenCXX/debug-info-template-explicit-specialization.cpp +++ b/clang/test/CodeGenCXX/debug-info-template-explicit-specialization.cpp @@ -110,7 +110,7 @@ struct j_wrap { }; j_wrap<j<int>> j_wrap_j; // CHECK: DICompositeType(tag: DW_TAG_structure_type, name: "j<int, int>" -// CHECK: DICompositeType(tag: DW_TAG_structure_type, name: "j_wrap<j<int, int> >" +// CHECK: DICompositeType(tag: DW_TAG_structure_type, name: "j_wrap<j<int, int>>" template <typename T> struct k { diff --git a/clang/test/Misc/diag-aka-types.cpp b/clang/test/Misc/diag-aka-types.cpp index c386504a6c56..3e051bdddec6 100644 --- a/clang/test/Misc/diag-aka-types.cpp +++ b/clang/test/Misc/diag-aka-types.cpp @@ -50,9 +50,9 @@ template <typename T> class A {}; int a1 = A<decltype(1 + 2)>(); // expected-error{{no viable conversion from 'A<decltype(1 + 2)>' (aka 'A<int>') to 'int'}} -int a2 = A<A<decltype(1 + 2)>>(); // expected-error{{no viable conversion from 'A<A<decltype(1 + 2)> >' (aka 'A<A<int> >') to 'int'}} +int a2 = A<A<decltype(1 + 2)>>(); // expected-error{{no viable conversion from 'A<A<decltype(1 + 2)>>' (aka 'A<A<int>>') to 'int'}} int a3 = A<__typeof(1 + 2)>(); // expected-error{{no viable conversion from 'A<typeof (1 + 2)>' (aka 'A<int>') to 'int'}} -int a4 = A<A<__typeof(1 + 2)>>(); // expected-error{{no viable conversion from 'A<A<typeof (1 + 2)> >' (aka 'A<A<int> >') to 'int'}} +int a4 = A<A<__typeof(1 + 2)>>(); // expected-error{{no viable conversion from 'A<A<typeof (1 + 2)>>' (aka 'A<A<int>>') to 'int'}} using B = A<decltype(1+2)>; int a5 = B(); // expected-error{{no viable conversion from 'B' (aka 'A<int>') to 'int'}} diff --git a/clang/test/Modules/ExtDebugInfo.cpp b/clang/test/Modules/ExtDebugInfo.cpp index 5d2921cd9959..a66c678227fe 100644 --- a/clang/test/Modules/ExtDebugInfo.cpp +++ b/clang/test/Modules/ExtDebugInfo.cpp @@ -85,14 +85,14 @@ void foo() { // This type is not anchored in the module by an explicit template instantiation. // CHECK: !DICompositeType(tag: DW_TAG_class_type, -// CHECK-SAME: name: "Template<long, DebugCXX::traits<long> >", +// CHECK-SAME: name: "Template<long, DebugCXX::traits<long>>", // CHECK-SAME: scope: ![[NS]], // CHECK-SAME: elements: // CHECK-SAME: identifier: "_ZTSN8DebugCXX8TemplateIlNS_6traitsIlEEEE") // This type is anchored in the module by an explicit template instantiation. // CHECK: !DICompositeType(tag: DW_TAG_class_type, -// CHECK-SAME: name: "Template<int, DebugCXX::traits<int> >", +// CHECK-SAME: name: "Template<int, DebugCXX::traits<int>>", // CHECK-SAME: scope: ![[NS]], // CHECK-SAME: flags: DIFlagFwdDecl, // CHECK-SAME: identifier: "_ZTSN8DebugCXX8TemplateIiNS_6traitsIiEEEE") @@ -103,7 +103,7 @@ void foo() { // This one isn't. // CHECK: !DICompositeType(tag: DW_TAG_class_type, -// CHECK-SAME: name: "Template<float, DebugCXX::traits<float> >", +// CHECK-SAME: name: "Template<float, DebugCXX::traits<float>>", // CHECK-SAME: scope: ![[NS]], // CHECK-SAME: elements: // CHECK-SAME: templateParams: diff --git a/clang/test/Modules/ModuleDebugInfo.cpp b/clang/test/Modules/ModuleDebugInfo.cpp index 40136978017c..c361053d03cd 100644 --- a/clang/test/Modules/ModuleDebugInfo.cpp +++ b/clang/test/Modules/ModuleDebugInfo.cpp @@ -65,7 +65,7 @@ // This type is anchored by an explicit template instantiation. // CHECK: !DICompositeType(tag: DW_TAG_class_type, -// CHECK-SAME: name: "Template<int, DebugCXX::traits<int> >" +// CHECK-SAME: name: "Template<int, DebugCXX::traits<int>>" // CHECK-SAME: elements: // CHECK-SAME: templateParams: // CHECK-SAME: identifier: "_ZTSN8DebugCXX8TemplateIiNS_6traitsIiEEEE") @@ -80,7 +80,7 @@ // CHECK-SAME: identifier: "_ZTSN8DebugCXX6traitsIfEE") // CHECK: !DICompositeType(tag: DW_TAG_class_type, -// CHECK-SAME: name: "Template<long, DebugCXX::traits<long> >" +// CHECK-SAME: name: "Template<long, DebugCXX::traits<long>>" // CHECK-SAME: elements: // CHECK-SAME: templateParams: // CHECK-SAME: identifier: "_ZTSN8DebugCXX8TemplateIlNS_6traitsIlEEEE") @@ -89,7 +89,7 @@ // no mangled name here yet. // CHECK: !DICompositeType(tag: DW_TAG_class_type, -// CHECK-SAME: name: "Template<float, DebugCXX::traits<float> >" +// CHECK-SAME: name: "Template<float, DebugCXX::traits<float>>" // CHECK-SAME: flags: DIFlagFwdDecl // CHECK-SAME: identifier: "_ZTSN8DebugCXX8TemplateIfNS_6traitsIfEEEE") diff --git a/clang/test/OpenMP/distribute_parallel_for_private_messages.cpp b/clang/test/OpenMP/distribute_parallel_for_private_messages.cpp index 05c9dbb07a36..d25598e46f81 100644 --- a/clang/test/OpenMP/distribute_parallel_for_private_messages.cpp +++ b/clang/test/OpenMP/distribute_parallel_for_private_messages.cpp @@ -312,7 +312,7 @@ int main(int argc, char **argv) { m = k + 2; s6 = s6_0; // expected-note {{in instantiation of member function 'S6<float>::operator=' requested here}} - s7 = s7_0; // expected-note {{in instantiation of member function 'S7<S6<float> >::operator=' requested here}} + s7 = s7_0; // expected-note {{in instantiation of member function 'S7<S6<float>>::operator=' requested here}} return foomain(argc, argv); // expected-note {{in instantiation of function template specialization 'foomain<int, char>' requested here}} } diff --git a/clang/test/OpenMP/distribute_parallel_for_simd_private_messages.cpp b/clang/test/OpenMP/distribute_parallel_for_simd_private_messages.cpp index d279d2fb9adc..43bc6ad8e637 100644 --- a/clang/test/OpenMP/distribute_parallel_for_simd_private_messages.cpp +++ b/clang/test/OpenMP/distribute_parallel_for_simd_private_messages.cpp @@ -312,7 +312,7 @@ int main(int argc, char **argv) { m = k + 2; s6 = s6_0; // expected-note {{in instantiation of member function 'S6<float>::operator=' requested here}} - s7 = s7_0; // expected-note {{in instantiation of member function 'S7<S6<float> >::operator=' requested here}} + s7 = s7_0; // expected-note {{in instantiation of member function 'S7<S6<float>>::operator=' requested here}} return foomain(argc, argv); // expected-note {{in instantiation of function template specialization 'foomain<int, char>' requested here}} } diff --git a/clang/test/OpenMP/distribute_simd_private_messages.cpp b/clang/test/OpenMP/distribute_simd_private_messages.cpp index 17ef7a0fbcfd..261a46ac6099 100644 --- a/clang/test/OpenMP/distribute_simd_private_messages.cpp +++ b/clang/test/OpenMP/distribute_simd_private_messages.cpp @@ -312,7 +312,7 @@ int main(int argc, char **argv) { m = k + 2; s6 = s6_0; // expected-note {{in instantiation of member function 'S6<float>::operator=' requested here}} - s7 = s7_0; // expected-note {{in instantiation of member function 'S7<S6<float> >::operator=' requested here}} + s7 = s7_0; // expected-note {{in instantiation of member function 'S7<S6<float>>::operator=' requested here}} return foomain(argc, argv); // expected-note {{in instantiation of function template specialization 'foomain<int, char>' requested here}} } diff --git a/clang/test/OpenMP/for_private_messages.cpp b/clang/test/OpenMP/for_private_messages.cpp index 877d683ce626..14219882f018 100644 --- a/clang/test/OpenMP/for_private_messages.cpp +++ b/clang/test/OpenMP/for_private_messages.cpp @@ -244,7 +244,7 @@ int main(int argc, char **argv) { si = k + 1; s6 = s6_0; // expected-note {{in instantiation of member function 'S6<float>::operator=' requested here}} - s7 = s7_0; // expected-note {{in instantiation of member function 'S7<S6<float> >::operator=' requested here}} + s7 = s7_0; // expected-note {{in instantiation of member function 'S7<S6<float>>::operator=' requested here}} return foomain(argc, argv); // expected-note {{in instantiation of function template specialization 'foomain<int, char>' requested here}} } diff --git a/clang/test/OpenMP/for_simd_private_messages.cpp b/clang/test/OpenMP/for_simd_private_messages.cpp index 0bf33797e0b9..c2e2ef5e5bb2 100644 --- a/clang/test/OpenMP/for_simd_private_messages.cpp +++ b/clang/test/OpenMP/for_simd_private_messages.cpp @@ -234,7 +234,7 @@ int main(int argc, char **argv) { m = k + 2; s6 = s6_0; // expected-note {{in instantiation of member function 'S6<float>::operator=' requested here}} - s7 = s7_0; // expected-note {{in instantiation of member function 'S7<S6<float> >::operator=' requested here}} + s7 = s7_0; // expected-note {{in instantiation of member function 'S7<S6<float>>::operator=' requested here}} return foomain(argc, argv); // expected-note {{in instantiation of function template specialization 'foomain<int, char>' requested here}} } diff --git a/clang/test/OpenMP/master_taskloop_private_messages.cpp b/clang/test/OpenMP/master_taskloop_private_messages.cpp index 30220cb294e4..66540ecdee03 100644 --- a/clang/test/OpenMP/master_taskloop_private_messages.cpp +++ b/clang/test/OpenMP/master_taskloop_private_messages.cpp @@ -253,7 +253,7 @@ int main(int argc, char **argv) { si = k + 1; s6 = s6_0; // expected-note {{in instantiation of member function 'S6<float>::operator=' requested here}} - s7 = s7_0; // expected-note {{in instantiation of member function 'S7<S6<float> >::operator=' requested here}} + s7 = s7_0; // expected-note {{in instantiation of member function 'S7<S6<float>>::operator=' requested here}} return foomain(argc, argv); // expected-note {{in instantiation of function template specialization 'foomain<int, char>' requested here}} } diff --git a/clang/test/OpenMP/master_taskloop_simd_private_messages.cpp b/clang/test/OpenMP/master_taskloop_simd_private_messages.cpp index 721c649bee17..ea209c53b54b 100644 --- a/clang/test/OpenMP/master_taskloop_simd_private_messages.cpp +++ b/clang/test/OpenMP/master_taskloop_simd_private_messages.cpp @@ -253,7 +253,7 @@ int main(int argc, char **argv) { si = k + 1; s6 = s6_0; // expected-note {{in instantiation of member function 'S6<float>::operator=' requested here}} - s7 = s7_0; // expected-note {{in instantiation of member function 'S7<S6<float> >::operator=' requested here}} + s7 = s7_0; // expected-note {{in instantiation of member function 'S7<S6<float>>::operator=' requested here}} return foomain(argc, argv); // expected-note {{in instantiation of function template specialization 'foomain<int, char>' requested here}} } diff --git a/clang/test/OpenMP/parallel_for_private_messages.cpp b/clang/test/OpenMP/parallel_for_private_messages.cpp index 3f742600e1a6..4c888c0eab22 100644 --- a/clang/test/OpenMP/parallel_for_private_messages.cpp +++ b/clang/test/OpenMP/parallel_for_private_messages.cpp @@ -234,7 +234,7 @@ int main(int argc, char **argv) { m = k + 2; s6 = s6_0; // expected-note {{in instantiation of member function 'S6<float>::operator=' requested here}} - s7 = s7_0; // expected-note {{in instantiation of member function 'S7<S6<float> >::operator=' requested here}} + s7 = s7_0; // expected-note {{in instantiation of member function 'S7<S6<float>>::operator=' requested here}} return foomain(argc, argv); // expected-note {{in instantiation of function template specialization 'foomain<int, char>' requested here}} } diff --git a/clang/test/OpenMP/parallel_for_simd_private_messages.cpp b/clang/test/OpenMP/parallel_for_simd_private_messages.cpp index 40ea8ecdc159..05de18e9f7dc 100644 --- a/clang/test/OpenMP/parallel_for_simd_private_messages.cpp +++ b/clang/test/OpenMP/parallel_for_simd_private_messages.cpp @@ -234,7 +234,7 @@ int main(int argc, char **argv) { m = k + 3; s6 = s6_0; // expected-note {{in instantiation of member function 'S6<float>::operator=' requested here}} - s7 = s7_0; // expected-note {{in instantiation of member function 'S7<S6<float> >::operator=' requested here}} + s7 = s7_0; // expected-note {{in instantiation of member function 'S7<S6<float>>::operator=' requested here}} return foomain(argc, argv); // expected-note {{in instantiation of function template specialization 'foomain<int, char>' requested here}} } diff --git a/clang/test/OpenMP/parallel_master_private_messages.cpp b/clang/test/OpenMP/parallel_master_private_messages.cpp index 2e21a1acd3fd..93716dab69ae 100644 --- a/clang/test/OpenMP/parallel_master_private_messages.cpp +++ b/clang/test/OpenMP/parallel_master_private_messages.cpp @@ -278,7 +278,7 @@ int main(int argc, char **argv) { } s6 = s6_0; // expected-note {{in instantiation of member function 'S6<float>::operator=' requested here}} - s7 = s7_0; // expected-note {{in instantiation of member function 'S7<S6<float> >::operator=' requested here}} + s7 = s7_0; // expected-note {{in instantiation of member function 'S7<S6<float>>::operator=' requested here}} return foomain(argc, argv); // expected-note {{in instantiation of function template specialization 'foomain<int, char>' requested here}} } diff --git a/clang/test/OpenMP/parallel_master_taskloop_private_messages.cpp b/clang/test/OpenMP/parallel_master_taskloop_private_messages.cpp index 47b40f91b746..c6d2ca59515f 100644 --- a/clang/test/OpenMP/parallel_master_taskloop_private_messages.cpp +++ b/clang/test/OpenMP/parallel_master_taskloop_private_messages.cpp @@ -253,7 +253,7 @@ int main(int argc, char **argv) { si = k + 1; s6 = s6_0; // expected-note {{in instantiation of member function 'S6<float>::operator=' requested here}} - s7 = s7_0; // expected-note {{in instantiation of member function 'S7<S6<float> >::operator=' requested here}} + s7 = s7_0; // expected-note {{in instantiation of member function 'S7<S6<float>>::operator=' requested here}} return foomain(argc, argv); // expected-note {{in instantiation of function template specialization 'foomain<int, char>' requested here}} } diff --git a/clang/test/OpenMP/parallel_master_taskloop_simd_private_messages.cpp b/clang/test/OpenMP/parallel_master_taskloop_simd_private_messages.cpp index eb1b5c7a1eb9..2feee9aaf372 100644 --- a/clang/test/OpenMP/parallel_master_taskloop_simd_private_messages.cpp +++ b/clang/test/OpenMP/parallel_master_taskloop_simd_private_messages.cpp @@ -253,7 +253,7 @@ int main(int argc, char **argv) { si = k + 1; s6 = s6_0; // expected-note {{in instantiation of member function 'S6<float>::operator=' requested here}} - s7 = s7_0; // expected-note {{in instantiation of member function 'S7<S6<float> >::operator=' requested here}} + s7 = s7_0; // expected-note {{in instantiation of member function 'S7<S6<float>>::operator=' requested here}} return foomain(argc, argv); // expected-note {{in instantiation of function template specialization 'foomain<int, char>' requested here}} } diff --git a/clang/test/OpenMP/parallel_sections_private_messages.cpp b/clang/test/OpenMP/parallel_sections_private_messages.cpp index 7e9a6e41b738..728e41815810 100644 --- a/clang/test/OpenMP/parallel_sections_private_messages.cpp +++ b/clang/test/OpenMP/parallel_sections_private_messages.cpp @@ -278,7 +278,7 @@ int main(int argc, char **argv) { } s6 = s6_0; // expected-note {{in instantiation of member function 'S6<float>::operator=' requested here}} - s7 = s7_0; // expected-note {{in instantiation of member function 'S7<S6<float> >::operator=' requested here}} + s7 = s7_0; // expected-note {{in instantiation of member function 'S7<S6<float>>::operator=' requested here}} return foomain(argc, argv); // expected-note {{in instantiation of function template specialization 'foomain<int, char>' requested here}} } diff --git a/clang/test/OpenMP/sections_private_messages.cpp b/clang/test/OpenMP/sections_private_messages.cpp index e032c7a5ecea..c89effd85a6e 100644 --- a/clang/test/OpenMP/sections_private_messages.cpp +++ b/clang/test/OpenMP/sections_private_messages.cpp @@ -278,7 +278,7 @@ int main(int argc, char **argv) { } s6 = s6_0; // expected-note {{in instantiation of member function 'S6<float>::operator=' requested here}} - s7 = s7_0; // expected-note {{in instantiation of member function 'S7<S6<float> >::operator=' requested here}} + s7 = s7_0; // expected-note {{in instantiation of member function 'S7<S6<float>>::operator=' requested here}} return foomain(argc, argv); // expected-note {{in instantiation of function template specialization 'foomain<int, char>' requested here}} } diff --git a/clang/test/OpenMP/simd_private_messages.cpp b/clang/test/OpenMP/simd_private_messages.cpp index 12927b07d199..dea0574d75aa 100644 --- a/clang/test/OpenMP/simd_private_messages.cpp +++ b/clang/test/OpenMP/simd_private_messages.cpp @@ -191,7 +191,7 @@ int main(int argc, char **argv) { for (int k = 0; k < argc; ++k) ++k; s6 = s6_0; // expected-note {{in instantiation of member function 'S6<float>::operator=' requested here}} - s7 = s7_0; // expected-note {{in instantiation of member function 'S7<S6<float> >::operator=' requested here}} + s7 = s7_0; // expected-note {{in instantiation of member function 'S7<S6<float>>::operator=' requested here}} return foomain(argc, argv); // expected-note {{in instantiation of function template specialization 'foomain<int, char>' requested here}} } diff --git a/clang/test/OpenMP/single_private_messages.cpp b/clang/test/OpenMP/single_private_messages.cpp index e809f0732a1b..ff742ac26f24 100644 --- a/clang/test/OpenMP/single_private_messages.cpp +++ b/clang/test/OpenMP/single_private_messages.cpp @@ -200,7 +200,7 @@ int main(int argc, char **argv) { foo(); s6 = s6_0; // expected-note {{in instantiation of member function 'S6<float>::operator=' requested here}} - s7 = s7_0; // expected-note {{in instantiation of member function 'S7<S6<float> >::operator=' requested here}} + s7 = s7_0; // expected-note {{in instantiation of member function 'S7<S6<float>>::operator=' requested here}} return foomain(argc, argv); // expected-note {{in instantiation of function template specialization 'foomain<int, char>' requested here}} } diff --git a/clang/test/OpenMP/target_firstprivate_messages.cpp b/clang/test/OpenMP/target_firstprivate_messages.cpp index f5e0c4c9143d..0a3079bbf83e 100644 --- a/clang/test/OpenMP/target_firstprivate_messages.cpp +++ b/clang/test/OpenMP/target_firstprivate_messages.cpp @@ -211,7 +211,7 @@ int main(int argc, char **argv) { #pragma omp target map(i) firstprivate(i) // expected-error {{firstprivate variable cannot be in a map clause in '#pragma omp target' directive}} {} s6 = s6_0; // expected-note {{in instantiation of member function 'S6<float>::operator=' requested here}} - s7 = s7_0; // expected-note {{in instantiation of member function 'S7<S6<float> >::operator=' requested here}} + s7 = s7_0; // expected-note {{in instantiation of member function 'S7<S6<float>>::operator=' requested here}} return foomain(argc, argv); // expected-note {{in instantiation of function template specialization 'foomain<int, char>' requested here}} } diff --git a/clang/test/OpenMP/target_parallel_for_private_messages.cpp b/clang/test/OpenMP/target_parallel_for_private_messages.cpp index b11981e06635..124eadb61de7 100644 --- a/clang/test/OpenMP/target_parallel_for_private_messages.cpp +++ b/clang/test/OpenMP/target_parallel_for_private_messages.cpp @@ -237,7 +237,7 @@ int main(int argc, char **argv) { m = k + 2; s6 = s6_0; // expected-note {{in instantiation of member function 'S6<float>::operator=' requested here}} - s7 = s7_0; // expected-note {{in instantiation of member function 'S7<S6<float> >::operator=' requested here}} + s7 = s7_0; // expected-note {{in instantiation of member function 'S7<S6<float>>::operator=' requested here}} return foomain(argc, argv); // expected-note {{in instantiation of function template specialization 'foomain<int, char>' requested here}} } diff --git a/clang/test/OpenMP/target_parallel_for_simd_private_messages.cpp b/clang/test/OpenMP/target_parallel_for_simd_private_messages.cpp index 5f54dfa2f987..6a0f40e28539 100644 --- a/clang/test/OpenMP/target_parallel_for_simd_private_messages.cpp +++ b/clang/test/OpenMP/target_parallel_for_simd_private_messages.cpp @@ -237,7 +237,7 @@ int main(int argc, char **argv) { m = k + 2; s6 = s6_0; // expected-note {{in instantiation of member function 'S6<float>::operator=' requested here}} - s7 = s7_0; // expected-note {{in instantiation of member function 'S7<S6<float> >::operator=' requested here}} + s7 = s7_0; // expected-note {{in instantiation of member function 'S7<S6<float>>::operator=' requested here}} return foomain(argc, argv); // expected-note {{in instantiation of function template specialization 'foomain<int, char>' requested here}} } diff --git a/clang/test/OpenMP/target_private_messages.cpp b/clang/test/OpenMP/target_private_messages.cpp index d8d96b5476cb..2b9fd35c05c6 100644 --- a/clang/test/OpenMP/target_private_messages.cpp +++ b/clang/test/OpenMP/target_private_messages.cpp @@ -204,7 +204,7 @@ int main(int argc, char **argv) { #pragma omp target map(i) private(i) // expected-error {{private variable cannot be in a map clause in '#pragma omp target' directive}} {} s6 = s6_0; // expected-note {{in instantiation of member function 'S6<float>::operator=' requested here}} - s7 = s7_0; // expected-note {{in instantiation of member function 'S7<S6<float> >::operator=' requested here}} + s7 = s7_0; // expected-note {{in instantiation of member function 'S7<S6<float>>::operator=' requested here}} return foomain(argc, argv); // expected-note {{in instantiation of function template specialization 'foomain<int, char>' requested here}} } diff --git a/clang/test/OpenMP/target_simd_private_messages.cpp b/clang/test/OpenMP/target_simd_private_messages.cpp index 44732863b4e2..ee0122f2da50 100644 --- a/clang/test/OpenMP/target_simd_private_messages.cpp +++ b/clang/test/OpenMP/target_simd_private_messages.cpp @@ -237,7 +237,7 @@ int main(int argc, char **argv) { m = k + 2; s6 = s6_0; // expected-note {{in instantiation of member function 'S6<float>::operator=' requested here}} - s7 = s7_0; // expected-note {{in instantiation of member function 'S7<S6<float> >::operator=' requested here}} + s7 = s7_0; // expected-note {{in instantiation of member function 'S7<S6<float>>::operator=' requested here}} return foomain(argc, argv); // expected-note {{in instantiation of function template specialization 'foomain<int, char>' requested here}} } diff --git a/clang/test/OpenMP/taskloop_private_messages.cpp b/clang/test/OpenMP/taskloop_private_messages.cpp index bc563ca112cb..d15d60c4b751 100644 --- a/clang/test/OpenMP/taskloop_private_messages.cpp +++ b/clang/test/OpenMP/taskloop_private_messages.cpp @@ -253,7 +253,7 @@ int main(int argc, char **argv) { si = k + 1; s6 = s6_0; // expected-note {{in instantiation of member function 'S6<float>::operator=' requested here}} - s7 = s7_0; // expected-note {{in instantiation of member function 'S7<S6<float> >::operator=' requested here}} + s7 = s7_0; // expected-note {{in instantiation of member function 'S7<S6<float>>::operator=' requested here}} return foomain(argc, argv); // expected-note {{in instantiation of function template specialization 'foomain<int, char>' requested here}} } diff --git a/clang/test/OpenMP/taskloop_simd_private_messages.cpp b/clang/test/OpenMP/taskloop_simd_private_messages.cpp index c7b7ba05426b..be697b9ed8a3 100644 --- a/clang/test/OpenMP/taskloop_simd_private_messages.cpp +++ b/clang/test/OpenMP/taskloop_simd_private_messages.cpp @@ -253,7 +253,7 @@ int main(int argc, char **argv) { si = k + 1; s6 = s6_0; // expected-note {{in instantiation of member function 'S6<float>::operator=' requested here}} - s7 = s7_0; // expected-note {{in instantiation of member function 'S7<S6<float> >::operator=' requested here}} + s7 = s7_0; // expected-note {{in instantiation of member function 'S7<S6<float>>::operator=' requested here}} return foomain(argc, argv); // expected-note {{in instantiation of function template specialization 'foomain<int, char>' requested here}} } diff --git a/clang/test/SemaTemplate/instantiate-member-expr.cpp b/clang/test/SemaTemplate/instantiate-member-expr.cpp index 6ba94b28df62..abe7ec8f5445 100644 --- a/clang/test/SemaTemplate/instantiate-member-expr.cpp +++ b/clang/test/SemaTemplate/instantiate-member-expr.cpp @@ -16,7 +16,7 @@ class ExprEngine { template <typename CHECKER> void registerCheck(CHECKER *check) { - Checkers.push_back(S<void *>()); // expected-note {{in instantiation of member function 'vector<S<void *> >::push_back' requested here}} + Checkers.push_back(S<void *>()); // expected-note {{in instantiation of member function 'vector<S<void *>>::push_back' requested here}} } }; diff --git a/clang/unittests/AST/DeclPrinterTest.cpp b/clang/unittests/AST/DeclPrinterTest.cpp index e6732cc3f315..018e99237ae9 100644 --- a/clang/unittests/AST/DeclPrinterTest.cpp +++ b/clang/unittests/AST/DeclPrinterTest.cpp @@ -1158,8 +1158,8 @@ TEST(DeclPrinter, TestTemplateArgumentList4) { "template<typename T> struct X {};" "Z<X<int>> A;", "A", - "Z<X<int> > A")); - // Should be: with semicolon, without extra space in "> >" + "Z<X<int>> A")); + // Should be: with semicolon } TEST(DeclPrinter, TestTemplateArgumentList5) { _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits