diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2012-10-15 18:58:50 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2012-10-15 18:58:50 +0000 |
commit | 14ec3f3acb46c7049256d87784ee44e1f96d0cd6 (patch) | |
tree | 3bb23c5da9241d4ed4b56ed8f61fcd433dcfc2ea /clang/lib/AST/Comment.cpp | |
parent | 5a89e0ef07ea80a03416e617e77ecd66ba11e698 (diff) | |
download | llvm-14ec3f3acb46c7049256d87784ee44e1f96d0cd6.zip llvm-14ec3f3acb46c7049256d87784ee44e1f96d0cd6.tar.gz llvm-14ec3f3acb46c7049256d87784ee44e1f96d0cd6.tar.bz2 |
structured document comment: patch to provide comment for overriding function
template when comment is comming from overridden declaration.
// rdar://12378793
llvm-svn: 165953
Diffstat (limited to 'clang/lib/AST/Comment.cpp')
-rw-r--r-- | clang/lib/AST/Comment.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/clang/lib/AST/Comment.cpp b/clang/lib/AST/Comment.cpp index a443b91..a235b60 100644 --- a/clang/lib/AST/Comment.cpp +++ b/clang/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 |