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
5 #define READONLY readonly
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}}
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}}
14 @property (getter = MyGetter2, READONLY) IBOutlet NSView *myView2; // expected-warning {{readonly IBOutlet property 'myView2' when auto-synthesized may not work correctly with 'nib' loader}}
25 @interface NSObject @end
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;
33 @interface RKTFHView()
34 @property( readwrite ) __attribute__((iboutlet)) UILabel *autoReadOnlyReadWrite;
35 @property( readwrite ) __attribute__((iboutlet)) UILabel *synthReadOnlyReadWrite;
38 @implementation RKTFHView
39 @synthesize synthReadOnlyReadWrite=_synthReadOnlyReadWrite;
45 @property IBOutlet __weak WeakOutlet* WeakProp;
49 __weak WeakOutlet* pwi;
50 pwi.WeakProp = (WeakOutlet*)0;
51 pwi.WeakProp = pwi.WeakProp;
55 WeakOutlet* func2(WeakOutlet* pwi) {
56 [[pwi WeakProp] setNumber:0];
57 [[pwi WeakProp] setNumber:1];
58 return [pwi WeakProp];