[PATCH] D55393: Re-order content of template parameter dumps

Stephen Kelly via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Dec 6 15:31:20 PST 2018


steveire created this revision.
steveire added a reviewer: aaron.ballman.
Herald added a subscriber: cfe-commits.

Repository:
  rC Clang

https://reviews.llvm.org/D55393

Files:
  lib/AST/ASTDumper.cpp
  test/AST/ast-dump-decl.cpp


Index: test/AST/ast-dump-decl.cpp
===================================================================
--- test/AST/ast-dump-decl.cpp
+++ test/AST/ast-dump-decl.cpp
@@ -327,21 +327,21 @@
 
 // CHECK:      ClassTemplateDecl 0x{{[^ ]*}} prev 0x{{[^ ]*}} {{.*}} TestTemplateDefaultType
 // CHECK-NEXT:   TemplateTypeParmDecl
-// CHECK-NEXT:     TemplateArgument type 'int'
 // CHECK-NEXT:     inherited from TemplateTypeParm 0x{{[^ ]*}} 'T'
+// CHECK-NEXT:     TemplateArgument type 'int'
 
 // CHECK:      ClassTemplateDecl 0x{{[^ ]*}} prev 0x{{[^ ]*}} {{.*}} TestTemplateDefaultNonType
 // CHECK-NEXT:   NonTypeTemplateParmDecl
+// CHECK-NEXT:     inherited from NonTypeTemplateParm 0x{{[^ ]*}} 'I' 'int'
 // CHECK-NEXT:     TemplateArgument expr
 // CHECK-NEXT:       ConstantExpr
 // CHECK-NEXT:         IntegerLiteral
-// CHECK-NEXT:     inherited from NonTypeTemplateParm 0x{{[^ ]*}} 'I' 'int'
 
 // CHECK:      ClassTemplateDecl 0x{{[^ ]*}} prev 0x{{[^ ]*}} {{.*}} TestTemplateTemplateDefaultType
 // CHECK-NEXT:   TemplateTemplateParmDecl
 // CHECK-NEXT:     TemplateTypeParmDecl
-// CHECK-NEXT:     TemplateArgument
 // CHECK-NEXT:     inherited from TemplateTemplateParm 0x{{[^ ]*}} 'TT'
+// CHECK-NEXT:     TemplateArgument
 
 // PR15220 dump instantiation only once
 namespace testCanonicalTemplate {
Index: lib/AST/ASTDumper.cpp
===================================================================
--- lib/AST/ASTDumper.cpp
+++ lib/AST/ASTDumper.cpp
@@ -1410,11 +1410,11 @@
   if (D->isParameterPack())
     OS << " ...";
   NodeDumper.dumpName(D);
-  if (D->hasDefaultArgument())
-    dumpTemplateArgument(D->getDefaultArgument());
   if (auto *From = D->getDefaultArgStorage().getInheritedFrom())
     dumpDeclRef(From, D->defaultArgumentWasInherited() ? "inherited from"
                                                        : "previous");
+  if (D->hasDefaultArgument())
+    dumpTemplateArgument(D->getDefaultArgument());
 }
 
 void ASTDumper::VisitNonTypeTemplateParmDecl(const NonTypeTemplateParmDecl *D) {
@@ -1423,11 +1423,11 @@
   if (D->isParameterPack())
     OS << " ...";
   NodeDumper.dumpName(D);
-  if (D->hasDefaultArgument())
-    dumpTemplateArgument(D->getDefaultArgument());
   if (auto *From = D->getDefaultArgStorage().getInheritedFrom())
     dumpDeclRef(From, D->defaultArgumentWasInherited() ? "inherited from"
                                                        : "previous");
+  if (D->hasDefaultArgument())
+    dumpTemplateArgument(D->getDefaultArgument());
 }
 
 void ASTDumper::VisitTemplateTemplateParmDecl(
@@ -1437,11 +1437,11 @@
     OS << " ...";
   NodeDumper.dumpName(D);
   dumpTemplateParameters(D->getTemplateParameters());
-  if (D->hasDefaultArgument())
-    dumpTemplateArgumentLoc(D->getDefaultArgument());
   if (auto *From = D->getDefaultArgStorage().getInheritedFrom())
     dumpDeclRef(From, D->defaultArgumentWasInherited() ? "inherited from"
                                                        : "previous");
+  if (D->hasDefaultArgument())
+    dumpTemplateArgumentLoc(D->getDefaultArgument());
 }
 
 void ASTDumper::VisitUsingDecl(const UsingDecl *D) {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D55393.177070.patch
Type: text/x-patch
Size: 3150 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20181206/a2dde477/attachment.bin>


More information about the cfe-commits mailing list