diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2011-04-08 23:48:29 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2011-04-08 23:48:29 +0000 |
commit | 36178092294301d26b8c77f755dae9489a9a722c (patch) | |
tree | a3e510591bdd368636d22ac3b69fc5501149b186 | |
parent | ec7346077c1fb423c9279771675c098bc2dffc92 (diff) |
Fixes a rewrting bug of a property-dot syntax expression inside
a block. First part of // rdar://9254348
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129171 91177308-0d34-0410-b5e6-96231b3b80d8
-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 + + |