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 | dce750b15eb5eb797ac9bbea118333d7d1896831 (patch) | |
tree | af9963563e4e9ae8a515faad42b140db2a57b45b /lib/AST/ASTContext.cpp | |
parent | 279e0be96cb51f6eb25c5ef21066c50d8a667826 (diff) |
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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162238 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/ASTContext.cpp')
-rw-r--r-- | lib/AST/ASTContext.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/lib/AST/ASTContext.cpp b/lib/AST/ASTContext.cpp index c02132329e..0452730201 100644 --- a/lib/AST/ASTContext.cpp +++ b/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; |