2010-02-13 01:52:31 +08:00
|
|
|
// RUN: %clang_cc1 -x objective-c++ -Wno-return-type -fblocks -fms-extensions -rewrite-objc %s -o %t-rw.cpp
|
2010-02-17 06:13:48 +08:00
|
|
|
// RUN: %clang_cc1 -fsyntax-only -Wno-address-of-temporary -D"SEL=void*" -D"__declspec(X)=" %t-rw.cpp
|
2010-02-13 01:52:31 +08:00
|
|
|
// radar 7638400
|
|
|
|
|
2010-02-17 06:13:48 +08:00
|
|
|
typedef void * id;
|
2010-02-24 09:25:40 +08:00
|
|
|
void *sel_registerName(const char *);
|
2010-02-17 06:13:48 +08:00
|
|
|
|
2010-02-13 01:52:31 +08:00
|
|
|
@interface X
|
|
|
|
@end
|
|
|
|
|
|
|
|
void foo(void (^block)(int));
|
|
|
|
|
|
|
|
@implementation X
|
|
|
|
static void enumerateIt(void (^block)(id, id, char *)) {
|
|
|
|
foo(^(int idx) { });
|
|
|
|
}
|
|
|
|
@end
|
|
|
|
|
2010-02-17 01:26:03 +08:00
|
|
|
// radar 7651312
|
|
|
|
void apply(void (^block)(int));
|
|
|
|
|
|
|
|
static void x(int (^cmp)(int, int)) {
|
|
|
|
x(cmp);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void y(int (^cmp)(int, int)) {
|
|
|
|
apply(^(int sect) {
|
|
|
|
x(cmp);
|
|
|
|
});
|
|
|
|
}
|
2010-02-18 09:20:22 +08:00
|
|
|
|
|
|
|
// radar 7659483
|
|
|
|
void *_Block_copy(const void *aBlock);
|
|
|
|
void x(void (^block)(void)) {
|
|
|
|
block = ((__typeof(block))_Block_copy((const void *)(block)));
|
|
|
|
}
|
2010-02-24 09:25:40 +08:00
|
|
|
|
2010-02-24 09:37:04 +08:00
|
|
|
// radar 7682763
|
2010-02-24 09:25:40 +08:00
|
|
|
@interface Y {
|
|
|
|
@private
|
|
|
|
id _private;
|
|
|
|
}
|
|
|
|
- (void (^)(void))f;
|
|
|
|
@end
|
|
|
|
|
|
|
|
typedef void (^void_block_t)(void);
|
|
|
|
|
|
|
|
@interface YY {
|
|
|
|
void_block_t __completion;
|
|
|
|
}
|
|
|
|
@property (copy) void_block_t f;
|
|
|
|
@end
|
|
|
|
|
|
|
|
@implementation Y
|
|
|
|
- (void (^)(void))f {
|
|
|
|
return [_private f];
|
|
|
|
}
|
|
|
|
|
|
|
|
@end
|
|
|
|
|