From 3ab6222fd1a7af8d57a614ce76686c75ce9fa18e Mon Sep 17 00:00:00 2001 From: Fariborz Jahanian Date: Wed, 7 Aug 2013 16:40:29 +0000 Subject: [PATCH] Patch to fix doxygen trailing comments for ObjectiveC methods. // rdar://14258334 llvm-svn: 187893 --- clang/lib/AST/ASTContext.cpp | 2 +- clang/test/Index/comment-misc-tags.m | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp index 1fcb6aa1c820..65e5e6daaa5d 100644 --- a/clang/lib/AST/ASTContext.cpp +++ b/clang/lib/AST/ASTContext.cpp @@ -183,7 +183,7 @@ RawComment *ASTContext::getRawCommentForDeclNoCache(const Decl *D) const { if (Comment != RawComments.end() && (*Comment)->isDocumentation() && (*Comment)->isTrailingComment() && (isa(D) || isa(D) || isa(D) || - isa(D))) { + isa(D) || isa(D))) { std::pair CommentBeginDecomp = SourceMgr.getDecomposedLoc((*Comment)->getSourceRange().getBegin()); // Check that Doxygen trailing comment comes after the declaration, starts diff --git a/clang/test/Index/comment-misc-tags.m b/clang/test/Index/comment-misc-tags.m index 85553b0e1314..19affec3bdb7 100644 --- a/clang/test/Index/comment-misc-tags.m +++ b/clang/test/Index/comment-misc-tags.m @@ -119,6 +119,7 @@ struct Test {int filler;}; @property (nonatomic, copy, readwrite) NSString * property1; @property (nonatomic, copy, readwrite) NSString * property2; ///< This is the second property and it does not work. @property (nonatomic, copy, readwrite) NSString * property3; /**< This is the third property and it does not work. */ +- (void)test; /*!< documentation for test method */ @end // CHECK: CommentAST=[ // CHECK-NEXT: (CXComment_FullComment @@ -132,3 +133,7 @@ struct Test {int filler;}; // CHECK-NEXT: (CXComment_FullComment // CHECK-NEXT: (CXComment_Paragraph // CHECK-NEXT: (CXComment_Text Text=[ This is the third property and it does not work. ])))] +// CHECK: CommentAST=[ +// CHECK-NEXT: (CXComment_FullComment +// CHECK-NEXT: (CXComment_Paragraph +// CHECK-NEXT: (CXComment_Text Text=[ documentation for test method ])))] -- 2.34.1