summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2013-08-06 23:29:00 +0000
committerFariborz Jahanian <fjahanian@apple.com>2013-08-06 23:29:00 +0000
commitfad2854058b156c1622e85e4e02ea5bfbbb5c1f9 (patch)
tree0789fc4ad5b2f663d7601ea4bda9fbdf4639db35
parentf5a988b35f5ababf5504751c778c4ffe19a9a33b (diff)
downloadbcm5719-llvm-fad2854058b156c1622e85e4e02ea5bfbbb5c1f9.tar.gz
bcm5719-llvm-fad2854058b156c1622e85e4e02ea5bfbbb5c1f9.zip
Patch to fix doxygen trailing comments for ObjectiveC properties.
// rdar://14258334 llvm-svn: 187835
-rw-r--r--clang/lib/AST/ASTContext.cpp3
-rw-r--r--clang/test/Index/comment-misc-tags.m24
2 files changed, 26 insertions, 1 deletions
diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp
index 63b1b0ead18..1fcb6aa1c82 100644
--- a/clang/lib/AST/ASTContext.cpp
+++ b/clang/lib/AST/ASTContext.cpp
@@ -182,7 +182,8 @@ RawComment *ASTContext::getRawCommentForDeclNoCache(const Decl *D) const {
// First check whether we have a trailing comment.
if (Comment != RawComments.end() &&
(*Comment)->isDocumentation() && (*Comment)->isTrailingComment() &&
- (isa<FieldDecl>(D) || isa<EnumConstantDecl>(D) || isa<VarDecl>(D))) {
+ (isa<FieldDecl>(D) || isa<EnumConstantDecl>(D) || isa<VarDecl>(D) ||
+ isa<ObjCPropertyDecl>(D))) {
std::pair<FileID, unsigned> 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 9eae5489fc0..85553b0e131 100644
--- a/clang/test/Index/comment-misc-tags.m
+++ b/clang/test/Index/comment-misc-tags.m
@@ -108,3 +108,27 @@ struct Test {int filler;};
// CHECK: (CXComment_BlockCommand CommandName=[par]
// CHECK-NEXT: (CXComment_Paragraph
// CHECK-NEXT: (CXComment_Text Text=[ And this is the second paragraph.])))
+
+// rdar://14258334
+@class NSString;
+
+@interface MyClass {
+}
+
+/// This is the first property and it always worked.
+@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. */
+@end
+// CHECK: CommentAST=[
+// CHECK-NEXT: (CXComment_FullComment
+// CHECK-NEXT: (CXComment_Paragraph
+// CHECK-NEXT: (CXComment_Text Text=[ This is the first property and it always worked.])))]
+// CHECK: CommentAST=[
+// CHECK-NEXT: (CXComment_FullComment
+// CHECK-NEXT: (CXComment_Paragraph
+// CHECK-NEXT: (CXComment_Text Text=[ This is the second property and it does not work.])))]
+// CHECK: CommentAST=[
+// CHECK-NEXT: (CXComment_FullComment
+// CHECK-NEXT: (CXComment_Paragraph
+// CHECK-NEXT: (CXComment_Text Text=[ This is the third property and it does not work. ])))]
OpenPOWER on IntegriCloud