61 lines · plain
1// RUN: %clang_cc1 -fsyntax-only -verify -disable-objc-default-synthesize-properties %s2 3@interface NSObject @end4 5@protocol TopProtocol6 @property (readonly) id myString; // expected-note {{property}}7@end8 9@protocol SubProtocol <TopProtocol>10@end11 12@interface TopClass : NSObject <TopProtocol> {}13@end14 15@interface SubClass : TopClass <SubProtocol> {}16@end17 18@interface SubClass1 : TopClass {} 19@end20 21@implementation SubClass1 @end // Test1 - No Warning22 23@implementation TopClass // expected-warning {{property 'myString' requires method 'myString' to be defined}}24@end25 26@implementation SubClass // Test3 - No Warning 27@end28 29@interface SubClass2 : TopClass<TopProtocol> 30@end31 32@implementation SubClass2 @end // Test 4 - No Warning33 34@interface SubClass3 : TopClass<SubProtocol> @end35@implementation SubClass3 @end // Test 5 - No Warning 36 37@interface SubClass4 : SubClass3 @end38@implementation SubClass4 @end // Test 5 - No Warning39 40@protocol NewProtocol41 @property (readonly) id myNewString; // expected-note {{property}}42@end43 44@interface SubClass5 : SubClass4 <NewProtocol> @end45@implementation SubClass5 @end // expected-warning {{property 'myNewString' requires method 'myNewString' to be defined}}46 47@protocol SuperProtocol48@end49 50@interface Super <SuperProtocol> 51@end52 53@protocol ProtocolWithProperty <SuperProtocol>54@property (readonly, assign) id invalidationBacktrace; // expected-note {{property}}55@end56 57@interface INTF : Super <ProtocolWithProperty> 58@end59 60@implementation INTF @end // expected-warning{{property 'invalidationBacktrace' requires method 'invalidationBacktrace' to be defined}}61