File tree Expand file tree Collapse file tree 3 files changed +17
-3
lines changed Expand file tree Collapse file tree 3 files changed +17
-3
lines changed Original file line number Diff line number Diff line change @@ -123,6 +123,9 @@ AST Dumping Potentially Breaking Changes
123123
124124 ``__atomic_test_and_set(p, 0) ``
125125
126+ - Pretty-printing of templates with inherited (i.e. specified in a previous
127+ redeclaration) default arguments has been fixed.
128+
126129Clang Frontend Potentially Breaking Changes
127130-------------------------------------------
128131- Members of anonymous unions/structs are now injected as ``IndirectFieldDecl ``
Original file line number Diff line number Diff line change @@ -1894,7 +1894,7 @@ void DeclPrinter::VisitTemplateTypeParmDecl(const TemplateTypeParmDecl *TTP) {
18941894 Out << TTP->getDeclName ();
18951895 }
18961896
1897- if (TTP->hasDefaultArgument ()) {
1897+ if (TTP->hasDefaultArgument () && !TTP-> defaultArgumentWasInherited () ) {
18981898 Out << " = " ;
18991899 TTP->getDefaultArgument ().getArgument ().print (Policy, Out,
19001900 /* IncludeType=*/ false );
@@ -1909,7 +1909,7 @@ void DeclPrinter::VisitNonTypeTemplateParmDecl(
19091909 Policy.CleanUglifiedParameters ? II->deuglifiedName () : II->getName ();
19101910 printDeclType (NTTP->getType (), Name, NTTP->isParameterPack ());
19111911
1912- if (NTTP->hasDefaultArgument ()) {
1912+ if (NTTP->hasDefaultArgument () && !NTTP-> defaultArgumentWasInherited () ) {
19131913 Out << " = " ;
19141914 NTTP->getDefaultArgument ().getArgument ().print (Policy, Out,
19151915 /* IncludeType=*/ false );
Original file line number Diff line number Diff line change @@ -290,9 +290,9 @@ KW DeclGroupInMemberList {
290290// A tag decl group in the tag decl's own member list is exercised in
291291// defSelfRef above.
292292
293+ #ifdef __cplusplus
293294
294295// Check out-of-line record definition
295- #ifdef __cplusplus
296296// PRINT-CXX-NEXT: [[KW]] OutOfLineRecord {
297297KW OutOfLineRecord {
298298 // PRINT-CXX-NEXT: [[KW]] Inner
@@ -304,4 +304,15 @@ KW OutOfLineRecord {
304304KW OutOfLineRecord ::Inner {
305305 // PRINT-CXX-NEXT: };
306306};
307+
308+ // PRINT-CXX-NEXT: template <typename, typename = int> [[KW]] SmearedTypeDefArgs;
309+ template < typename , typename = int > KW SmearedTypeDefArgs ;
310+ // PRINT-CXX-NEXT: template <typename = int, typename> [[KW]] SmearedTypeDefArgs;
311+ template < typename = int , typename > KW SmearedTypeDefArgs ;
312+
313+ // PRINT-CXX-NEXT: template <int, int = 0> [[KW]] SmearedNTTPDefArgs;
314+ template < int , int = 0 > KW SmearedNTTPDefArgs ;
315+ // PRINT-CXX-NEXT: template <int = 0, int> [[KW]] SmearedNTTPDefArgs;
316+ template < int = 0 , int > KW SmearedNTTPDefArgs ;
317+
307318#endif
You can’t perform that action at this time.
0 commit comments