2015-03-25 01:14:20 +08:00
|
|
|
// RUN: %clang_cc1 -fsyntax-only -fobjc-arc -Wno-objc-root-class -Wreceiver-is-weak -Warc-repeated-use-of-weak -fobjc-runtime-has-weak -verify %s
|
|
|
|
// RUN: %clang_cc1 -x objective-c++ -fsyntax-only -fobjc-arc -Wno-objc-root-class -Wreceiver-is-weak -Warc-repeated-use-of-weak -fobjc-runtime-has-weak -verify %s
|
2012-05-20 02:17:17 +08:00
|
|
|
// rdar://11448209
|
2015-03-25 01:14:20 +08:00
|
|
|
// rdar://20259376
|
2012-05-20 02:17:17 +08:00
|
|
|
|
2012-05-22 01:02:43 +08:00
|
|
|
#define READONLY readonly
|
|
|
|
|
2012-05-20 02:17:17 +08:00
|
|
|
@class NSView;
|
|
|
|
|
2014-08-09 07:46:25 +08:00
|
|
|
IB_DESIGNABLE @interface I
|
2013-02-09 15:13:16 +08:00
|
|
|
@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}}
|
2012-05-22 01:02:43 +08:00
|
|
|
|
2014-08-09 07:46:25 +08:00
|
|
|
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}}
|
2012-05-22 01:02:43 +08:00
|
|
|
|
2013-02-09 15:13:16 +08:00
|
|
|
@property (getter = MyGetter, READONLY) IBOutlet NSView *myView2; // expected-warning {{readonly IBOutlet property 'myView2' when auto-synthesized may not work correctly with 'nib' loader}}
|
2012-05-22 01:02:43 +08:00
|
|
|
|
2012-05-20 02:17:17 +08:00
|
|
|
@end
|
|
|
|
|
2013-02-09 15:13:16 +08:00
|
|
|
@implementation I
|
2012-05-20 02:17:17 +08:00
|
|
|
@end
|
2013-02-09 07:32:30 +08:00
|
|
|
|
|
|
|
|
|
|
|
// rdar://13123861
|
|
|
|
@class UILabel;
|
|
|
|
|
|
|
|
@interface NSObject @end
|
|
|
|
|
|
|
|
@interface RKTFHView : NSObject
|
2013-02-09 15:13:16 +08:00
|
|
|
@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}}
|
2013-02-09 07:32:30 +08:00
|
|
|
@property( readonly ) __attribute__((iboutlet)) UILabel *autoReadOnlyReadWrite;
|
|
|
|
@property( readonly ) __attribute__((iboutlet)) UILabel *synthReadOnlyReadWrite;
|
|
|
|
@end
|
|
|
|
|
|
|
|
@interface RKTFHView()
|
|
|
|
@property( readwrite ) __attribute__((iboutlet)) UILabel *autoReadOnlyReadWrite;
|
|
|
|
@property( readwrite ) __attribute__((iboutlet)) UILabel *synthReadOnlyReadWrite;
|
|
|
|
@end
|
|
|
|
|
2013-02-09 15:13:16 +08:00
|
|
|
@implementation RKTFHView
|
2013-02-09 07:32:30 +08:00
|
|
|
@synthesize synthReadOnlyReadWrite=_synthReadOnlyReadWrite;
|
|
|
|
@end
|
2014-06-18 07:35:13 +08:00
|
|
|
|
|
|
|
// rdar://15885642
|
|
|
|
@interface WeakOutlet
|
|
|
|
@property IBOutlet __weak WeakOutlet* WeakProp;
|
|
|
|
@end
|
|
|
|
|
|
|
|
WeakOutlet* func() {
|
|
|
|
__weak WeakOutlet* pwi;
|
|
|
|
pwi.WeakProp = (WeakOutlet*)0;
|
|
|
|
pwi.WeakProp = pwi.WeakProp;
|
|
|
|
return pwi.WeakProp;
|
|
|
|
}
|