2012-04-07 02:12:22 +08:00
|
|
|
// RUN: %clang_cc1 -fsyntax-only -triple x86_64-apple-darwin10 -fblocks -verify -Wno-objc-root-class %s
|
|
|
|
// RUN: %clang_cc1 -x objective-c++ -fsyntax-only -triple x86_64-apple-darwin10 -fblocks -verify -Wno-objc-root-class %s
|
2011-04-13 07:39:33 +08:00
|
|
|
// rdar://9154582
|
|
|
|
|
|
|
|
@interface Blocky @end
|
|
|
|
|
|
|
|
@implementation Blocky {
|
|
|
|
int _a;
|
|
|
|
}
|
2011-07-13 01:16:56 +08:00
|
|
|
- (int)doAThing {
|
2011-04-13 07:39:33 +08:00
|
|
|
^{
|
2011-07-13 01:16:56 +08:00
|
|
|
char self;
|
|
|
|
return _a;
|
2011-04-13 07:39:33 +08:00
|
|
|
}();
|
2011-07-13 01:16:56 +08:00
|
|
|
return _a;
|
2011-04-13 07:39:33 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
@end
|
|
|
|
|
2011-04-16 01:04:42 +08:00
|
|
|
|
|
|
|
// rdar://9284603
|
|
|
|
@interface ShadowSelf
|
|
|
|
{
|
|
|
|
int _anIvar;
|
|
|
|
}
|
|
|
|
@end
|
|
|
|
|
|
|
|
@interface C {
|
|
|
|
int _cIvar;
|
|
|
|
}
|
|
|
|
@end
|
|
|
|
|
|
|
|
@implementation ShadowSelf
|
|
|
|
- (void)doSomething {
|
|
|
|
__typeof(self) newSelf = self;
|
|
|
|
{
|
|
|
|
__typeof(self) self = newSelf;
|
|
|
|
(void)_anIvar;
|
|
|
|
}
|
|
|
|
{
|
2011-07-13 01:16:56 +08:00
|
|
|
C* self;
|
|
|
|
(void) _anIvar;
|
2011-04-16 01:04:42 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
- (void)doAThing {
|
|
|
|
^{
|
2011-07-13 01:16:56 +08:00
|
|
|
id self;
|
|
|
|
(void)_anIvar;
|
2011-04-16 01:04:42 +08:00
|
|
|
}();
|
|
|
|
}
|
|
|
|
@end
|
|
|
|
|