1 // RUN: %clang_cc1 -fsyntax-only -verify -Wno-objc-root-class %s
3 @interface NSString @end
5 @interface NSObject @end
9 @property (retain) NSString* what;
12 @implementation SynthItAll
13 #if !__has_feature(objc_default_synthesize_properties)
14 @synthesize howMany, what;
19 @interface SynthSetter : NSObject
20 @property (nonatomic) int howMany; // REM: nonatomic to avoid warnings about only implementing one of the pair
21 @property (nonatomic, retain) NSString* what;
24 @implementation SynthSetter
25 #if !__has_feature(objc_default_synthesize_properties)
26 @synthesize howMany, what;
32 // - (void) setHowMany: (int) value
37 // - (void) setWhat: (NSString*) value
41 @interface SynthGetter : NSObject
42 @property (nonatomic) int howMany; // REM: nonatomic to avoid warnings about only implementing one of the pair
43 @property (nonatomic, retain) NSString* what;
46 @implementation SynthGetter
47 #if !__has_feature(objc_default_synthesize_properties)
48 @synthesize howMany, what;
52 - (void) setHowMany: (int) value {
57 - (void) setWhat: (NSString*) value {
58 if (self.what != value) {
64 @interface SynthNone : NSObject
65 @property int howMany;
66 @property (retain) NSString* what;
69 @implementation SynthNone
70 #if !__has_feature(objc_default_synthesize_properties)
71 @synthesize howMany, what; // REM: Redundant anyway
77 - (void) setHowMany: (int) value {
84 - (void) setWhat: (NSString*) value {
85 if (self.what != value) {
91 @property (readonly) id myString;
94 @interface TopClass <TopProtocol>
100 @interface SubClass : TopClass <TopProtocol>
103 @implementation SubClass @end
106 @interface C (Category)
107 @property int p; // expected-note 2 {{property declared here}}
109 @implementation C (Category) // expected-warning {{property 'p' requires method 'p' to be defined}} \
110 // expected-warning {{property 'p' requires method 'setP:' to be defined}}
113 // Don't complain if a property is already @synthesized by usr.
121 - (int) Meth { return self.PROP; }
122 #if __has_feature(objc_default_synthesize_properties)
123 @synthesize PROP=IVAR;
128 @property (nonatomic, strong) NSString *requiredString; // expected-note {{property declared here}}
131 @property (nonatomic, strong) NSString *optionalString;
134 @interface MyClass <MyProtocol>
137 @implementation MyClass // expected-warning {{auto property synthesis will not synthesize property 'requiredString' declared in protocol 'MyProtocol'}}
138 @end // expected-note {{add a '@synthesize' directive}}
140 @protocol NSObject @end
141 @protocol TMSourceManagerDelegate<NSObject>
144 @protocol TMSourceManager <NSObject>
145 @property (nonatomic, assign) id <TMSourceManagerDelegate> delegate;
148 @interface TMSourceManager
149 @property (nonatomic, assign) id <TMSourceManagerDelegate> delegate;
152 @protocol TMTimeZoneManager <TMSourceManager>
155 @interface TimeZoneManager : TMSourceManager <TMTimeZoneManager>
158 @implementation TimeZoneManager
162 @property (assign) id prot;
165 @interface Base<BaseProt>
168 @interface I : Base<BaseProt>