1 // RUN: %clang_cc1 -fsyntax-only -fobjc-nonfragile-abi -fobjc-default-synthesize-properties -verify %s
3 @interface NSString @end
5 @interface NSObject @end
9 @property (retain) NSString* what;
12 @implementation SynthItAll
13 //@synthesize howMany, what;
17 @interface SynthSetter : NSObject
18 @property (nonatomic) int howMany; // REM: nonatomic to avoid warnings about only implementing one of the pair
19 @property (nonatomic, retain) NSString* what;
22 @implementation SynthSetter
23 //@synthesize howMany, what;
28 // - (void) setHowMany: (int) value
33 // - (void) setWhat: (NSString*) value
37 @interface SynthGetter : NSObject
38 @property (nonatomic) int howMany; // REM: nonatomic to avoid warnings about only implementing one of the pair
39 @property (nonatomic, retain) NSString* what;
42 @implementation SynthGetter
43 //@synthesize howMany, what;
46 - (void) setHowMany: (int) value {
51 - (void) setWhat: (NSString*) value {
52 if (self.what != value) {
58 @interface SynthNone : NSObject
59 @property int howMany;
60 @property (retain) NSString* what;
63 @implementation SynthNone
64 //@synthesize howMany, what; // REM: Redundant anyway
69 - (void) setHowMany: (int) value {
76 - (void) setWhat: (NSString*) value {
77 if (self.what != value) {
83 @property (readonly) id myString;
86 @interface TopClass <TopProtocol>
92 @interface SubClass : TopClass <TopProtocol>
95 @implementation SubClass @end
99 @interface C (Category)
100 @property int p; // expected-warning {{property 'p' requires method 'p' to be defined }} \
101 // expected-warning {{property 'p' requires method 'setP:' to be defined}}
103 @implementation C (Category) // expected-note 2 {{implementation is here}}
106 // Don't complain if a property is already @synthesized by usr.
114 - (int) Meth { return self.PROP; }
115 @synthesize PROP=IVAR;