aboutsummaryrefslogtreecommitdiff
path: root/lib/AST/ASTContext.cpp
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2013-04-17 21:05:20 +0000
committerFariborz Jahanian <fjahanian@apple.com>2013-04-17 21:05:20 +0000
commit099ecfb0ed137665a3394187030d8fd7183fd9d4 (patch)
treeedbace20f791cb643e0b883e4362c416b8b2c00b /lib/AST/ASTContext.cpp
parentabee27ba69494c142ee4acf9eca91dab7dea1b32 (diff)
[document parsing]: When tag declaration (but not definition!)
is part of the decl-specifier-seq of some other declaration, it doesn't get comment. // rdar://12390371 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179722 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/ASTContext.cpp')
-rw-r--r--lib/AST/ASTContext.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/AST/ASTContext.cpp b/lib/AST/ASTContext.cpp
index 341f854c42..f9622455c0 100644
--- a/lib/AST/ASTContext.cpp
+++ b/lib/AST/ASTContext.cpp
@@ -97,7 +97,12 @@ RawComment *ASTContext::getRawCommentForDeclNoCache(const Decl *D) const {
if (ED->getTemplateSpecializationKind() == TSK_ImplicitInstantiation)
return NULL;
}
-
+ if (const TagDecl *TD = dyn_cast<TagDecl>(D)) {
+ // When tag declaration (but not definition!) is part of the
+ // decl-specifier-seq of some other declaration, it doesn't get comment
+ if (TD->isEmbeddedInDeclarator() && !TD->isCompleteDefinition())
+ return NULL;
+ }
// TODO: handle comments for function parameters properly.
if (isa<ParmVarDecl>(D))
return NULL;