diff --git a/clang/lib/AST/ASTDumper.cpp b/clang/lib/AST/ASTDumper.cpp index eb5a7d3b05d5..54efed289a6e 100644 --- a/clang/lib/AST/ASTDumper.cpp +++ b/clang/lib/AST/ASTDumper.cpp @@ -2069,7 +2069,7 @@ void ASTDumper::visitParamCommandComment(const ParamCommandComment *C) { OS << " Param=\"" << C->getParamNameAsWritten() << "\""; } - if (C->isParamIndexValid()) + if (C->isParamIndexValid() && !C->isVarArgParam()) OS << " ParamIndex=" << C->getParamIndex(); } diff --git a/clang/test/Misc/ast-dump-comment.cpp b/clang/test/Misc/ast-dump-comment.cpp index 4e84af01a516..5bd6934d80cf 100644 --- a/clang/test/Misc/ast-dump-comment.cpp +++ b/clang/test/Misc/ast-dump-comment.cpp @@ -67,3 +67,11 @@ int Test_VerbatimBlockComment; // CHECK: VarDecl{{.*}}Test_VerbatimBlockComment // CHECK: VerbatimBlockComment{{.*}} Name="verbatim" CloseName="endverbatim" // CHECK-NEXT: VerbatimBlockLineComment{{.*}} Text=" Aaa" + +/// \param ... More arguments +template +void Test_TemplatedFunctionVariadic(int arg, ...); +// CHECK: FunctionTemplateDecl{{.*}}Test_TemplatedFunctionVariadic +// CHECK: ParamCommandComment{{.*}} [in] implicitly Param="..." +// CHECK-NEXT: ParagraphComment +// CHECK-NEXT: TextComment{{.*}} Text=" More arguments"