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 | 8bdb58a7835a9a90dd9b9791fccf269cbc1dcef3 (patch) | |
tree | 8113d564235d6d532d37eda0b1769ffab74ba993 /lib/AST/ASTContext.cpp | |
parent | 5676d32a23faf0506f5c295980c2876c862488d5 (diff) |
Attaching documentation comments to declarations: don't attach a comment to a declaration if there is a preprocessor directive between them.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159305 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/ASTContext.cpp')
-rw-r--r-- | lib/AST/ASTContext.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/AST/ASTContext.cpp b/lib/AST/ASTContext.cpp index ca631736d9..9fb2dc1a94 100644 --- a/lib/AST/ASTContext.cpp +++ b/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; |