48 lines · plain
1// RUN: %clang_cc1 -fsyntax-only -Weverything -verify %s2// expected-no-diagnostics3/** A property may not be both 'readonly' and having a memory management attribute4 (copy/retain/etc.). But, property declaration in primary class and protcols5 are tentative as they may be overridden into a 'readwrite' property in class 6 extensions. So, do not issue any warning on 'readonly' and memory management7 attributes in a property.8*/9 10@interface Super {11}12@end13 14@class NSString;15 16@interface MyClass : Super17@property(nonatomic, copy, readonly) NSString *prop;18@property(nonatomic, copy, readonly) id warnProp;19@end20 21@interface MyClass ()22@property(nonatomic, copy, readwrite) NSString *prop;23@end24 25@implementation MyClass26@synthesize prop;27@synthesize warnProp;28@end29 30 31@protocol P32@property(nonatomic, copy, readonly) NSString *prop;33@property(nonatomic, copy, readonly) id warnProp;34@end35 36@interface YourClass : Super <P>37@end38 39@interface YourClass ()40@property(nonatomic, copy, readwrite) NSString *prop;41@end42 43@implementation YourClass 44@synthesize prop;45@synthesize warnProp;46@end47 48