From: Dmitri Gribenko Date: Thu, 28 Jun 2012 16:19:39 +0000 (+0000) Subject: Attaching comments to declarations: don't attach comments to implicit declarations. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c3fee3539fd00a6ce21dc1f574baf76686640072;p=clang Attaching comments to declarations: don't attach comments to implicit declarations. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159354 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/AST/ASTContext.cpp b/lib/AST/ASTContext.cpp index 9fb2dc1a94..820288eae3 100644 --- a/lib/AST/ASTContext.cpp +++ b/lib/AST/ASTContext.cpp @@ -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(D)) return NULL;