summaryrefslogtreecommitdiffstats
path: root/clang
diff options
context:
space:
mode:
authorDmitri Gribenko <gribozavr@gmail.com>2014-03-19 14:03:47 +0000
committerDmitri Gribenko <gribozavr@gmail.com>2014-03-19 14:03:47 +0000
commitdbff5c71fa4db894e29fe31776c2631880ff69e8 (patch)
tree1b5be05d1b2cb27f6b3906f11e84c38f4d68ae00 /clang
parentd9eb05aca3996b2e93b36c3f0bf84a6852c302b9 (diff)
downloadbcm5719-llvm-dbff5c71fa4db894e29fe31776c2631880ff69e8.tar.gz
bcm5719-llvm-dbff5c71fa4db894e29fe31776c2631880ff69e8.zip
Comment parsing: fix a crash when dumping comment ast for a function template
with variadic parameters Patch by Joe Ranieri. llvm-svn: 204236
Diffstat (limited to 'clang')
-rw-r--r--clang/lib/AST/ASTDumper.cpp2
-rw-r--r--clang/test/Misc/ast-dump-comment.cpp8
2 files changed, 9 insertions, 1 deletions
diff --git a/clang/lib/AST/ASTDumper.cpp b/clang/lib/AST/ASTDumper.cpp
index eb5a7d3b05d..54efed289a6 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 4e84af01a51..5bd6934d80c 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<typename T>
+void Test_TemplatedFunctionVariadic(int arg, ...);
+// CHECK: FunctionTemplateDecl{{.*}}Test_TemplatedFunctionVariadic
+// CHECK: ParamCommandComment{{.*}} [in] implicitly Param="..."
+// CHECK-NEXT: ParagraphComment
+// CHECK-NEXT: TextComment{{.*}} Text=" More arguments"
OpenPOWER on IntegriCloud