From aa0f2b30163872d0d9114dd03da71a7f17f57d5b Mon Sep 17 00:00:00 2001 From: Fariborz Jahanian Date: Fri, 24 Sep 2010 18:36:58 +0000 Subject: [PATCH] Fix rewriting of property declared in @protocol's. Fixed //rdar://8472487. llvm-svn: 114741 --- clang/lib/Rewrite/RewriteObjC.cpp | 4 ++++ clang/test/Rewriter/rewrite-protocol-qualified.mm | 9 +++++++++ 2 files changed, 13 insertions(+) diff --git a/clang/lib/Rewrite/RewriteObjC.cpp b/clang/lib/Rewrite/RewriteObjC.cpp index 578a063614a1..dd6cf93a3995 100644 --- a/clang/lib/Rewrite/RewriteObjC.cpp +++ b/clang/lib/Rewrite/RewriteObjC.cpp @@ -962,6 +962,10 @@ void RewriteObjC::RewriteProtocolDecl(ObjCProtocolDecl *PDecl) { I != E; ++I) RewriteMethodDeclaration(*I); + for (ObjCInterfaceDecl::prop_iterator I = PDecl->prop_begin(), + E = PDecl->prop_end(); I != E; ++I) + RewriteProperty(*I); + // Lastly, comment out the @end. SourceLocation LocEnd = PDecl->getAtEndRange().getBegin(); ReplaceText(LocEnd, strlen("@end"), "/* @end */"); diff --git a/clang/test/Rewriter/rewrite-protocol-qualified.mm b/clang/test/Rewriter/rewrite-protocol-qualified.mm index 5f12010afd4e..671aa6b08a03 100644 --- a/clang/test/Rewriter/rewrite-protocol-qualified.mm +++ b/clang/test/Rewriter/rewrite-protocol-qualified.mm @@ -30,3 +30,12 @@ void f() { id a; id b = bar((id )a); } + +// rdar://8472487 +@protocol NSObject @end +@class NSRunLoop; + +@protocol CoreDAVTaskManager + @property (retain) NSRunLoop *workRunLoop; +@end +