]> granicus.if.org Git - clang/commitdiff
Attaching comments to declarations: don't attach comments to implicit declarations.
authorDmitri Gribenko <gribozavr@gmail.com>
Thu, 28 Jun 2012 16:19:39 +0000 (16:19 +0000)
committerDmitri Gribenko <gribozavr@gmail.com>
Thu, 28 Jun 2012 16:19:39 +0000 (16:19 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159354 91177308-0d34-0410-b5e6-96231b3b80d8

lib/AST/ASTContext.cpp

index 9fb2dc1a94030f3ee74095f8ca48dd456c319990..820288eae38b80f40c91e44084c75463d145e9fd 100644 (file)
@@ -61,6 +61,10 @@ const RawComment *ASTContext::getRawCommentForDeclNoCache(const Decl *D) const {
 
   assert(D);
 
+  // User can not attach documentation to implicit declarations.
+  if (D->isImplicit())
+    return NULL;
+
   // TODO: handle comments for function parameters properly.
   if (isa<ParmVarDecl>(D))
     return NULL;