summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorDmitri Gribenko <gribozavr@gmail.com>2012-06-27 23:43:37 +0000
committerDmitri Gribenko <gribozavr@gmail.com>2012-06-27 23:43:37 +0000
commit7e8729b904f8c45aa5ccc889c0987dcb5f9c9d95 (patch)
treeaee8a73015f168139d6a0fb65ccb69edff5c4202 /clang/lib
parentb5c1a2b87c22d9da7c76416de089aff79d253e93 (diff)
downloadbcm5719-llvm-7e8729b904f8c45aa5ccc889c0987dcb5f9c9d95.tar.gz
bcm5719-llvm-7e8729b904f8c45aa5ccc889c0987dcb5f9c9d95.zip
Attaching documentation comments to declarations: don't attach a comment to a declaration if there is a preprocessor directive between them.
llvm-svn: 159305
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/AST/ASTContext.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp
index ca631736d90..9fb2dc1a940 100644
--- a/clang/lib/AST/ASTContext.cpp
+++ b/clang/lib/AST/ASTContext.cpp
@@ -134,8 +134,9 @@ const RawComment *ASTContext::getRawCommentForDeclNoCache(const Decl *D) const {
StringRef Text(Buffer + CommentEndDecomp.second,
DeclLocDecomp.second - CommentEndDecomp.second);
- // There should be no other declarations between comment and declaration.
- if (Text.find_first_of(",;{}") != StringRef::npos)
+ // There should be no other declarations or preprocessor directives between
+ // comment and declaration.
+ if (Text.find_first_of(",;{}#") != StringRef::npos)
return NULL;
return &*Comment;
OpenPOWER on IntegriCloud