diff options
-rw-r--r-- | lib/Rewrite/RewriteObjC.cpp | 1 | ||||
-rw-r--r-- | test/Rewriter/rewrite-block-literal-1.mm | 27 |
2 files changed, 28 insertions, 0 deletions
diff --git a/lib/Rewrite/RewriteObjC.cpp b/lib/Rewrite/RewriteObjC.cpp index 13cd671f12..298ed9a906 100644 --- a/lib/Rewrite/RewriteObjC.cpp +++ b/lib/Rewrite/RewriteObjC.cpp @@ -5558,6 +5558,7 @@ Stmt *RewriteObjC::RewriteFunctionBodyOrGlobalInitializer(Stmt *S) { // Rewrite the block body in place. Stmt *SaveCurrentBody = CurrentBody; CurrentBody = BE->getBody(); + CollectPropertySetters(CurrentBody); PropParentMap = 0; RewriteFunctionBodyOrGlobalInitializer(BE->getBody()); CurrentBody = SaveCurrentBody; diff --git a/test/Rewriter/rewrite-block-literal-1.mm b/test/Rewriter/rewrite-block-literal-1.mm new file mode 100644 index 0000000000..681d2ff077 --- /dev/null +++ b/test/Rewriter/rewrite-block-literal-1.mm @@ -0,0 +1,27 @@ +// RUN: %clang_cc1 -x objective-c++ -Wno-return-type -fblocks -fms-extensions -rewrite-objc %s -o %t-rw.cpp +// RUN: %clang_cc1 -fsyntax-only -Wno-address-of-temporary -Did="void *" -D"SEL=void*" -D"__declspec(X)=" %t-rw.cpp +// radar 9254348 + +void *sel_registerName(const char *); +typedef void (^BLOCK_TYPE)(void); + +@interface CoreDAVTaskGroup +{ + int IVAR; +} +@property int IVAR; +- (void) setCompletionBlock : (BLOCK_TYPE) arg; +@end + +@implementation CoreDAVTaskGroup +- (void)_finishInitialSync { + CoreDAVTaskGroup *folderPost; + [folderPost setCompletionBlock : (^{ + self.IVAR = 0; + })]; +} +@dynamic IVAR; +- (void) setCompletionBlock : (BLOCK_TYPE) arg {} +@end + + |