]> granicus.if.org Git - clang/commitdiff
Attaching documentation comments to declarations: don't attach a comment to a declara...
authorDmitri Gribenko <gribozavr@gmail.com>
Wed, 27 Jun 2012 23:43:37 +0000 (23:43 +0000)
committerDmitri Gribenko <gribozavr@gmail.com>
Wed, 27 Jun 2012 23:43:37 +0000 (23:43 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159305 91177308-0d34-0410-b5e6-96231b3b80d8

lib/AST/ASTContext.cpp
test/Index/annotate-comments.cpp

index ca631736d9043467eabe92598424968cb6120a06..9fb2dc1a94030f3ee74095f8ca48dd456c319990 100644 (file)
@@ -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;
index 64d1c983bc21eda61d2a4f947a0f258c7407ebc3..cb0630b739325aa07b35819ec6b835b283fff4c7 100644 (file)
@@ -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