aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/AST/Comment.cpp15
-rw-r--r--lib/AST/CommentDumper.cpp2
2 files changed, 16 insertions, 1 deletions
diff --git a/lib/AST/Comment.cpp b/lib/AST/Comment.cpp
index a443b91d09..a235b60bea 100644
--- a/lib/AST/Comment.cpp
+++ b/lib/AST/Comment.cpp
@@ -310,6 +310,21 @@ StringRef ParamCommandComment::getParamName(comments::FullComment *FC) const {
return Args[0].Text;
}
+StringRef TParamCommandComment::getParamName(comments::FullComment *FC) const {
+ if (FC && isPositionValid()) {
+ const TemplateParameterList *TPL = FC->getThisDeclInfo()->TemplateParameters;
+ for (unsigned i = 0, e = getDepth(); i != e; ++i) {
+ if (i == e-1)
+ return TPL->getParam(getIndex(i))->getName();
+ const NamedDecl *Param = TPL->getParam(getIndex(i));
+ if (const TemplateTemplateParmDecl *TTP =
+ dyn_cast<TemplateTemplateParmDecl>(Param))
+ TPL = TTP->getTemplateParameters();
+ }
+ }
+ return Args[0].Text;
+}
+
} // end namespace comments
} // end namespace clang
diff --git a/lib/AST/CommentDumper.cpp b/lib/AST/CommentDumper.cpp
index 36261c423b..4f51cd5622 100644
--- a/lib/AST/CommentDumper.cpp
+++ b/lib/AST/CommentDumper.cpp
@@ -197,7 +197,7 @@ void CommentDumper::visitTParamCommandComment(const TParamCommandComment *C) {
dumpComment(C);
if (C->hasParamName()) {
- OS << " Param=\"" << C->getParamName() << "\"";
+ OS << " Param=\"" << C->getParamName(const_cast<FullComment*>(FC)) << "\"";
}
if (C->isPositionValid()) {