1 // RUN: %clang_cc1 -fsyntax-only -triple x86_64-apple-darwin10 -fblocks -fobjc-nonfragile-abi -verify %s 2 // RUN: %clang_cc1 -x objective-c++ -fsyntax-only -triple x86_64-apple-darwin10 -fblocks -fobjc-nonfragile-abi -verify %s 3 // rdar://9154582 4 5 @interface Blocky @end 6 7 @implementation Blocky { 8 int _a; 9 } 10 - (int)doAThing { 11 ^{ 12 char self; 13 return _a; 14 }(); 15 return _a; 16 } 17 18 @end 19 20 21 // rdar://9284603 22 @interface ShadowSelf 23 { 24 int _anIvar; 25 } 26 @end 27 28 @interface C { 29 int _cIvar; 30 } 31 @end 32 33 @implementation ShadowSelf 34 - (void)doSomething { 35 __typeof(self) newSelf = self; 36 { 37 __typeof(self) self = newSelf; 38 (void)_anIvar; 39 } 40 { 41 C* self; 42 (void) _anIvar; 43 } 44 } 45 - (void)doAThing { 46 ^{ 47 id self; 48 (void)_anIvar; 49 }(); 50 } 51 @end 52 53