56 lines · plain
1// RUN: %clang_cc1 -fsyntax-only -fobjc-arc -Wno-objc-root-class -Warc-repeated-use-of-weak -fobjc-runtime-has-weak -verify %s2// RUN: %clang_cc1 -x objective-c++ -fsyntax-only -fobjc-arc -Wno-objc-root-class -Warc-repeated-use-of-weak -fobjc-runtime-has-weak -verify %s3 4#define READONLY readonly5 6@class NSView;7 8IB_DESIGNABLE @interface I9@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}}10 11IBInspectable @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}}12 13@property (getter = MyGetter2, READONLY) IBOutlet NSView *myView2; // expected-warning {{readonly IBOutlet property 'myView2' when auto-synthesized may not work correctly with 'nib' loader}}14 15@end16 17@implementation I18@end19 20@class UILabel;21 22@interface NSObject @end23 24@interface RKTFHView : NSObject25@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;28@end29 30@interface RKTFHView()31@property( readwrite ) __attribute__((iboutlet)) UILabel *autoReadOnlyReadWrite;32@property( readwrite ) __attribute__((iboutlet)) UILabel *synthReadOnlyReadWrite;33@end34 35@implementation RKTFHView36@synthesize synthReadOnlyReadWrite=_synthReadOnlyReadWrite;37@end38 39@interface WeakOutlet 40@property int Number;41@property IBOutlet __weak WeakOutlet* WeakProp;42@end43 44WeakOutlet* func(void) {45 __weak WeakOutlet* pwi;46 pwi.WeakProp = (WeakOutlet*)0;47 pwi.WeakProp = pwi.WeakProp;48 return pwi.WeakProp;49}50 51WeakOutlet* func2(WeakOutlet* pwi) {52 [[pwi WeakProp] setNumber:0];53 [[pwi WeakProp] setNumber:1];54 return [pwi WeakProp];55}56