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
4 #define READONLY readonly
8 IB_DESIGNABLE @interface I
9 @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 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 @property (getter = MyGetter2, READONLY) IBOutlet NSView *myView2; // expected-warning {{readonly IBOutlet property 'myView2' when auto-synthesized may not work correctly with 'nib' loader}}
22 @interface NSObject @end
24 @interface RKTFHView : NSObject
25 @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}}
26 @property( readonly ) __attribute__((iboutlet)) UILabel *autoReadOnlyReadWrite;
27 @property( readonly ) __attribute__((iboutlet)) UILabel *synthReadOnlyReadWrite;
30 @interface RKTFHView()
31 @property( readwrite ) __attribute__((iboutlet)) UILabel *autoReadOnlyReadWrite;
32 @property( readwrite ) __attribute__((iboutlet)) UILabel *synthReadOnlyReadWrite;
35 @implementation RKTFHView
36 @synthesize synthReadOnlyReadWrite=_synthReadOnlyReadWrite;
41 @property IBOutlet __weak WeakOutlet* WeakProp;
44 WeakOutlet* func(void) {
45 __weak WeakOutlet* pwi;
46 pwi.WeakProp = (WeakOutlet*)0;
47 pwi.WeakProp = pwi.WeakProp;
51 WeakOutlet* func2(WeakOutlet* pwi) {
52 [[pwi WeakProp] setNumber:0];
53 [[pwi WeakProp] setNumber:1];
54 return [pwi WeakProp];