Author: fjahanian
Date: Tue Aug 6 18:29:00 2013
New Revision: 187835
URL: http://llvm.org/viewvc/llvm-project?rev=187835&view=rev
Log:
Patch to fix doxygen trailing comments for ObjectiveC properties.
// rdar://14258334
Modified:
cfe/trunk/lib/AST/ASTContext.cpp
cfe/trunk/test/Index/comment-misc-tags.m
Modified: cfe/trunk/lib/AST/ASTContext.cpp
URL:
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/ASTContext.cpp?rev=187835&r1=187834&r2=187835&view=diff
==============================================================================
--- cfe/trunk/lib/AST/ASTContext.cpp (original)
+++ cfe/trunk/lib/AST/ASTContext.cpp Tue Aug 6 18:29:00 2013
@@ -182,7 +182,8 @@ RawComment *ASTContext::getRawCommentFor
// 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
Modified: cfe/trunk/test/Index/comment-misc-tags.m
URL:
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Index/comment-misc-tags.m?rev=187835&r1=187834&r2=187835&view=diff
==============================================================================
--- cfe/trunk/test/Index/comment-misc-tags.m (original)
+++ cfe/trunk/test/Index/comment-misc-tags.m Tue Aug 6 18:29:00 2013
@@ -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. ])))]
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits