summaryrefslogtreecommitdiffstats
path: root/clang
diff options
context:
space:
mode:
Diffstat (limited to 'clang')
-rw-r--r--clang/lib/AST/ASTContext.cpp5
-rw-r--r--clang/test/Index/annotate-comments.cpp4
2 files changed, 7 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;
diff --git a/clang/test/Index/annotate-comments.cpp b/clang/test/Index/annotate-comments.cpp
index 64d1c983bc2..cb0630b7393 100644
--- a/clang/test/Index/annotate-comments.cpp
+++ b/clang/test/Index/annotate-comments.cpp
@@ -194,6 +194,10 @@ void isdoxy44(void);
/// Ggg. IS_DOXYGEN_END
void isdoxy45(void);
+/// IS_DOXYGEN_NOT_ATTACHED
+#define FOO
+void notdoxy46(void);
+
#endif
// RUN: rm -rf %t
OpenPOWER on IntegriCloud