aboutsummaryrefslogtreecommitdiff
path: root/lib/AST/ASTContext.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/AST/ASTContext.cpp')
-rw-r--r--lib/AST/ASTContext.cpp5
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;