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
123
123
124
124
``__atomic_test_and_set(p, 0) ``
125
125
126
+ - Pretty-printing of templates with inherited (i.e. specified in a previous
127
+ redeclaration) default arguments has been fixed.
128
+
126
129
Clang Frontend Potentially Breaking Changes
127
130
-------------------------------------------
128
131
- 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) {
1894
1894
Out << TTP->getDeclName ();
1895
1895
}
1896
1896
1897
- if (TTP->hasDefaultArgument ()) {
1897
+ if (TTP->hasDefaultArgument () && !TTP-> defaultArgumentWasInherited () ) {
1898
1898
Out << " = " ;
1899
1899
TTP->getDefaultArgument ().getArgument ().print (Policy, Out,
1900
1900
/* IncludeType=*/ false );
@@ -1909,7 +1909,7 @@ void DeclPrinter::VisitNonTypeTemplateParmDecl(
1909
1909
Policy.CleanUglifiedParameters ? II->deuglifiedName () : II->getName ();
1910
1910
printDeclType (NTTP->getType (), Name, NTTP->isParameterPack ());
1911
1911
1912
- if (NTTP->hasDefaultArgument ()) {
1912
+ if (NTTP->hasDefaultArgument () && !NTTP-> defaultArgumentWasInherited () ) {
1913
1913
Out << " = " ;
1914
1914
NTTP->getDefaultArgument ().getArgument ().print (Policy, Out,
1915
1915
/* IncludeType=*/ false );
Original file line number Diff line number Diff line change @@ -290,9 +290,9 @@ KW DeclGroupInMemberList {
290
290
// A tag decl group in the tag decl's own member list is exercised in
291
291
// defSelfRef above.
292
292
293
+ #ifdef __cplusplus
293
294
294
295
// Check out-of-line record definition
295
- #ifdef __cplusplus
296
296
// PRINT-CXX-NEXT: [[KW]] OutOfLineRecord {
297
297
KW OutOfLineRecord {
298
298
// PRINT-CXX-NEXT: [[KW]] Inner
@@ -304,4 +304,15 @@ KW OutOfLineRecord {
304
304
KW OutOfLineRecord ::Inner {
305
305
// PRINT-CXX-NEXT: };
306
306
};
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
+
307
318
#endif
You can’t perform that action at this time.
0 commit comments