Skip to content

Commit b534d3a

Browse files
committed
[libclang] Remove comma from the blacklist of characters that prevent a comment to be attached to a decl.
It's common to use an availability function macro at the start of a decl. rdar://13965065 llvm-svn: 187230
1 parent 53900e5 commit b534d3a

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

clang/lib/AST/ASTContext.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ RawComment *ASTContext::getRawCommentForDeclNoCache(const Decl *D) const {
227227

228228
// There should be no other declarations or preprocessor directives between
229229
// comment and declaration.
230-
if (Text.find_first_of(",;{}#@") != StringRef::npos)
230+
if (Text.find_first_of(";{}#@") != StringRef::npos)
231231
return NULL;
232232

233233
return *Comment;

clang/test/Index/annotate-comments.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,13 @@ void isdoxy52(int);
247247
*/
248248
void isdoxy53(int);
249249

250+
#define MYMAC(x,y)
251+
/**
252+
* Aaa. IS_DOXYGEN_START IS_DOXYGEN_END
253+
*/
254+
MYMAC(0,0)
255+
void isdoxy54(int);
256+
250257
#endif
251258

252259
// RUN: rm -rf %t
@@ -327,4 +334,5 @@ void isdoxy53(int);
327334
// CHECK: annotate-comments.cpp:222:6: FunctionDecl=isdoxy50:{{.*}} BriefComment=[Returns ddd IS_DOXYGEN_END]
328335
// CHECK: annotate-comments.cpp:231:6: FunctionDecl=isdoxy51:{{.*}} BriefComment=[Aaa. IS_DOXYGEN_START]
329336
// CHECK: annotate-comments.cpp:241:6: FunctionDecl=isdoxy52:{{.*}} BriefComment=[Aaa. IS_DOXYGEN_START Bbb.]
330-
337+
// CHECK: annotate-comments.cpp:248:6: FunctionDecl=isdoxy53:{{.*}} BriefComment=[Aaa. IS_DOXYGEN_START IS_DOXYGEN_END]
338+
// CHECK: annotate-comments.cpp:255:6: FunctionDecl=isdoxy54:{{.*}} BriefComment=[Aaa. IS_DOXYGEN_START IS_DOXYGEN_END]

0 commit comments

Comments
 (0)