]> granicus.if.org Git - clang/commitdiff
Patch to fix doxygen trailing comments for ObjectiveC methods.
authorFariborz Jahanian <fjahanian@apple.com>
Wed, 7 Aug 2013 16:40:29 +0000 (16:40 +0000)
committerFariborz Jahanian <fjahanian@apple.com>
Wed, 7 Aug 2013 16:40:29 +0000 (16:40 +0000)
// rdar://14258334

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187893 91177308-0d34-0410-b5e6-96231b3b80d8

lib/AST/ASTContext.cpp
test/Index/comment-misc-tags.m

index 1fcb6aa1c820e7a0ee3664cfd5fd6c410c94b176..65e5e6daaa5d95874886cfa66b4ea9874b4bf019 100644 (file)
@@ -183,7 +183,7 @@ RawComment *ASTContext::getRawCommentForDeclNoCache(const Decl *D) const {
   if (Comment != RawComments.end() &&
       (*Comment)->isDocumentation() && (*Comment)->isTrailingComment() &&
       (isa<FieldDecl>(D) || isa<EnumConstantDecl>(D) || isa<VarDecl>(D) ||
-       isa<ObjCPropertyDecl>(D))) {
+       isa<ObjCMethodDecl>(D) || isa<ObjCPropertyDecl>(D))) {
     std::pair<FileID, unsigned> CommentBeginDecomp
       = SourceMgr.getDecomposedLoc((*Comment)->getSourceRange().getBegin());
     // Check that Doxygen trailing comment comes after the declaration, starts
index 85553b0e13143814a5ecd7a748b5bdaaf152eb68..19affec3bdb7e15fd7706e24943c5b5dfd713c50 100644 (file)
@@ -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 ])))]