diff options
author | Dmitri Gribenko <gribozavr@gmail.com> | 2012-06-27 23:43:37 +0000 |
---|---|---|
committer | Dmitri Gribenko <gribozavr@gmail.com> | 2012-06-27 23:43:37 +0000 |
commit | 7e8729b904f8c45aa5ccc889c0987dcb5f9c9d95 (patch) | |
tree | aee8a73015f168139d6a0fb65ccb69edff5c4202 /clang/lib | |
parent | b5c1a2b87c22d9da7c76416de089aff79d253e93 (diff) | |
download | bcm5719-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.cpp | 5 |
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; |