1 // RUN: %clang_cc1 -fsyntax-only -fobjc-arc -Wno-objc-root-class -Warc-repeated-use-of-weak -fobjc-runtime-has-weak -verify %s 2 // RUN: %clang_cc1 -x objective-c++ -fsyntax-only -fobjc-arc -Wno-objc-root-class -Warc-repeated-use-of-weak -fobjc-runtime-has-weak -verify %s 3 // rdar://11448209 4 5 #define READONLY readonly 6 7 @class NSView; 8 9 IB_DESIGNABLE @interface I 10 @property (getter = MyGetter, readonly, assign) IBOutlet NSView *myView; // expected-warning {{readonly IBOutlet property 'myView' when auto-synthesized may not work correctly with 'nib' loader}} expected-note {{property should be changed to be readwrite}} 11 12 IBInspectable @property (readonly) IBOutlet NSView *myView1; // expected-warning {{readonly IBOutlet property 'myView1' when auto-synthesized may not work correctly with 'nib' loader}} expected-note {{property should be changed to be readwrite}} 13 14 @property (getter = MyGetter, READONLY) IBOutlet NSView *myView2; // expected-warning {{readonly IBOutlet property 'myView2' when auto-synthesized may not work correctly with 'nib' loader}} 15 16 @end 17 18 @implementation I 19 @end 20 21 22 // rdar://13123861 23 @class UILabel; 24 25 @interface NSObject @end 26 27 @interface RKTFHView : NSObject 28 @property( readonly ) __attribute__((iboutlet)) UILabel *autoReadOnlyReadOnly; // expected-warning {{readonly IBOutlet property 'autoReadOnlyReadOnly' when auto-synthesized may not work correctly with 'nib' loader}} expected-note {{property should be changed to be readwrite}} 29 @property( readonly ) __attribute__((iboutlet)) UILabel *autoReadOnlyReadWrite; 30 @property( readonly ) __attribute__((iboutlet)) UILabel *synthReadOnlyReadWrite; 31 @end 32 33 @interface RKTFHView() 34 @property( readwrite ) __attribute__((iboutlet)) UILabel *autoReadOnlyReadWrite; 35 @property( readwrite ) __attribute__((iboutlet)) UILabel *synthReadOnlyReadWrite; 36 @end 37 38 @implementation RKTFHView 39 @synthesize synthReadOnlyReadWrite=_synthReadOnlyReadWrite; 40 @end 41 42 // rdar://15885642 43 @interface WeakOutlet 44 @property int Number; 45 @property IBOutlet __weak WeakOutlet* WeakProp; 46 @end 47 48 WeakOutlet* func() { 49 __weak WeakOutlet* pwi; 50 pwi.WeakProp = (WeakOutlet*)0; 51 pwi.WeakProp = pwi.WeakProp; 52 return pwi.WeakProp; 53 } 54 55 WeakOutlet* func2(WeakOutlet* pwi) { 56 [[pwi WeakProp] setNumber:0]; 57 [[pwi WeakProp] setNumber:1]; 58 return [pwi WeakProp]; 59 } 60