Index: lib/AST/ASTDumper.cpp =================================================================== --- lib/AST/ASTDumper.cpp +++ lib/AST/ASTDumper.cpp @@ -930,22 +930,6 @@ } } - if (const FunctionTemplateSpecializationInfo *FTSI = - D->getTemplateSpecializationInfo()) - dumpTemplateArgumentList(*FTSI->TemplateArguments); - - if (!D->param_begin() && D->getNumParams()) - dumpChild([=] { OS << "<getNumParams() << ">>"; }); - else - for (const ParmVarDecl *Parameter : D->parameters()) - dumpDecl(Parameter); - - if (const CXXConstructorDecl *C = dyn_cast(D)) - for (CXXConstructorDecl::init_const_iterator I = C->init_begin(), - E = C->init_end(); - I != E; ++I) - dumpCXXCtorInitializer(*I); - if (const CXXMethodDecl *MD = dyn_cast(D)) { if (MD->size_overridden_methods() != 0) { auto dumpOverride = [=](const CXXMethodDecl *D) { @@ -969,6 +953,22 @@ } } + if (!D->param_begin() && D->getNumParams()) + dumpChild([=] { OS << "<getNumParams() << ">>"; }); + else + for (const ParmVarDecl *Parameter : D->parameters()) + dumpDecl(Parameter); + + if (const FunctionTemplateSpecializationInfo *FTSI = + D->getTemplateSpecializationInfo()) + dumpTemplateArgumentList(*FTSI->TemplateArguments); + + if (const CXXConstructorDecl *C = dyn_cast(D)) + for (CXXConstructorDecl::init_const_iterator I = C->init_begin(), + E = C->init_end(); + I != E; ++I) + dumpCXXCtorInitializer(*I); + if (D->doesThisDeclarationHaveABody()) dumpStmt(D->getBody()); } Index: test/AST/ast-dump-decl.cpp =================================================================== --- test/AST/ast-dump-decl.cpp +++ test/AST/ast-dump-decl.cpp @@ -213,20 +213,20 @@ // CHECK-NEXT: ParmVarDecl{{.*}} 'T' // CHECK-NEXT: CompoundStmt // CHECK-NEXT: FunctionDecl{{.*}} TestFunctionTemplate {{.*}}A -// CHECK-NEXT: TemplateArgument // CHECK-NEXT: ParmVarDecl +// CHECK-NEXT: TemplateArgument // CHECK-NEXT: CompoundStmt // CHECK-NEXT: Function{{.*}} 'TestFunctionTemplate' {{.*}}B // CHECK-NEXT: FunctionDecl{{.*}} TestFunctionTemplate {{.*}}C -// CHECK-NEXT: TemplateArgument // CHECK-NEXT: ParmVarDecl -// CHECK-NEXT: FunctionDecl{{.*}} TestFunctionTemplate {{.*}}D // CHECK-NEXT: TemplateArgument +// CHECK-NEXT: FunctionDecl{{.*}} TestFunctionTemplate {{.*}}D // CHECK-NEXT: ParmVarDecl +// CHECK-NEXT: TemplateArgument // CHECK-NEXT: CompoundStmt // CHECK: FunctionDecl{{.*}} TestFunctionTemplate {{.*}}B -// CHECK-NEXT: TemplateArgument // CHECK-NEXT: ParmVarDecl +// CHECK-NEXT: TemplateArgument namespace testClassTemplateDecl { class A { }; @@ -355,8 +355,8 @@ // CHECK-NEXT: FunctionDecl{{.*}} TestFunctionTemplate 'void (T)' // CHECK-NEXT: ParmVarDecl{{.*}} 'T' // CHECK-NEXT: FunctionDecl{{.*}} TestFunctionTemplate {{.*}}A - // CHECK-NEXT: TemplateArgument // CHECK-NEXT: ParmVarDecl + // CHECK-NEXT: TemplateArgument // CHECK: FunctionTemplateDecl{{.*}} TestFunctionTemplate // CHECK-NEXT: TemplateTypeParmDecl // CHECK-NEXT: FunctionDecl{{.*}} TestFunctionTemplate 'void (T)' Index: test/AST/ast-dump-funcs.cpp =================================================================== --- test/AST/ast-dump-funcs.cpp +++ test/AST/ast-dump-funcs.cpp @@ -56,10 +56,10 @@ struct T : S { // T is not referenced, but S is void f(float, int = 100) override; // CHECK: CXXMethodDecl 0x{{[^ ]*}} col:8 f 'void (float, int)' + // CHECK-NEXT: Overrides: [ 0x{{[^ ]*}} S::f 'void (float, int)' ] // CHECK-NEXT: ParmVarDecl 0x{{[^ ]*}} col:15 'float' // CHECK-NEXT: ParmVarDecl 0x{{[^ ]*}} col:21 'int' cinit // CHECK-NEXT: IntegerLiteral 0x{{[^ ]*}} 'int' 100 - // CHECK-NEXT: Overrides: [ 0x{{[^ ]*}} S::f 'void (float, int)' ] // CHECK-NEXT: OverrideAttr // CHECK: CXXConstructorDecl 0x{{[^ ]*}} col:8 implicit T 'void (const T &)' inline default_delete noexcept-unevaluated Index: test/AST/float16.cpp =================================================================== --- test/AST/float16.cpp +++ test/AST/float16.cpp @@ -162,8 +162,8 @@ //CHECK-NEXT: | | |-DeclRefExpr {{.*}} 'C' lvalue ParmVar {{.*}} 'arg' 'C' //CHECK-NEXT: | | `-FloatingLiteral {{.*}} '_Float16' 2.000000e+00 //CHECK-NEXT: | `-FunctionDecl {{.*}} used func1t '_Float16 (_Float16)' -//CHECK-NEXT: | |-TemplateArgument type '_Float16' //CHECK-NEXT: | |-ParmVarDecl {{.*}} used arg '_Float16':'_Float16' +//CHECK-NEXT: | |-TemplateArgument type '_Float16' //CHECK-NEXT: | `-CompoundStmt //CHECK-NEXT: | `-ReturnStmt //CHECK-NEXT: | `-BinaryOperator {{.*}} '_Float16' '*'