diff options
author | Dmitri Gribenko <gribozavr@gmail.com> | 2012-08-20 22:36:31 +0000 |
---|---|---|
committer | Dmitri Gribenko <gribozavr@gmail.com> | 2012-08-20 22:36:31 +0000 |
commit | b1ad9939574b1efb2c8eac5b578c789caab76f45 (patch) | |
tree | 8ffb4c637927a778b06bf4e1877e739165b92ed1 | |
parent | b6b962395203f7f0032296826cbd6a2ff9ad7eee (diff) | |
download | bcm5719-llvm-b1ad9939574b1efb2c8eac5b578c789caab76f45.tar.gz bcm5719-llvm-b1ad9939574b1efb2c8eac5b578c789caab76f45.zip |
Attaching comments to declarations: ignore implicit decls. Decl::isImplicit()
does not return true for all implicit decls currently.
This should fix PR13634 for now, but Decl::isImplicit() should be fixed, too.
llvm-svn: 162238
-rw-r--r-- | clang/lib/AST/ASTContext.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp index c02132329e6..0452730201b 100644 --- a/clang/lib/AST/ASTContext.cpp +++ b/clang/lib/AST/ASTContext.cpp @@ -67,11 +67,29 @@ RawComment *ASTContext::getRawCommentForDeclNoCache(const Decl *D) const { return NULL; // User can not attach documentation to implicit instantiations. + // FIXME: all these implicit instantiations shoud be marked as implicit + // declarations and get caught by condition above. if (const FunctionDecl *FD = dyn_cast<FunctionDecl>(D)) { if (FD->getTemplateSpecializationKind() == TSK_ImplicitInstantiation) return NULL; } + if (const VarDecl *VD = dyn_cast<VarDecl>(D)) { + if (VD->isStaticDataMember() && + VD->getTemplateSpecializationKind() == TSK_ImplicitInstantiation) + return NULL; + } + + if (const CXXRecordDecl *CRD = dyn_cast<CXXRecordDecl>(D)) { + if (CRD->getTemplateSpecializationKind() == TSK_ImplicitInstantiation) + return NULL; + } + + if (const EnumDecl *ED = dyn_cast<EnumDecl>(D)) { + if (ED->getTemplateSpecializationKind() == TSK_ImplicitInstantiation) + return NULL; + } + // TODO: handle comments for function parameters properly. if (isa<ParmVarDecl>(D)) return NULL; |