Fixes a rewrting bug of a property-dot syntax expression inside

a block. First part of // rdar://9254348

llvm-svn: 129171
This commit is contained in:
Fariborz Jahanian 2011-04-08 23:48:29 +00:00
parent 778947c203
commit eae9c0e3df
2 changed files with 28 additions and 0 deletions

View File

@ -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;

View File

@ -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