Diag(PID->getLocation(), diag::note_property_synthesize);
continue;
}
+ ObjCPropertyDecl *PropInSuperClass = SuperPropMap[Prop->getIdentifier()];
if (ObjCProtocolDecl *Proto =
dyn_cast<ObjCProtocolDecl>(Prop->getDeclContext())) {
// We won't auto-synthesize properties declared in protocols.
// Suppress the warning if class's superclass implements property's
// getter and implements property's setter (if readwrite property).
- if (!SuperClassImplementsProperty(IDecl, Prop)) {
+ // Or, if property is going to be implemented in its super class.
+ if (!SuperClassImplementsProperty(IDecl, Prop) && !PropInSuperClass) {
Diag(IMPDecl->getLocation(),
diag::warn_auto_synthesizing_protocol_property)
<< Prop << Proto;
continue;
}
// If property to be implemented in the super class, ignore.
- if (ObjCPropertyDecl *PropInSuperClass =
- SuperPropMap[Prop->getIdentifier()]) {
+ if (PropInSuperClass) {
if ((Prop->getPropertyAttributes() & ObjCPropertyDecl::OBJC_PR_readwrite) &&
(PropInSuperClass->getPropertyAttributes() &
ObjCPropertyDecl::OBJC_PR_readonly) &&
// synthesized in the parent, let the parent invalidate it.
@protocol IDEBuildable <NSObject>
-@property (readonly, strong) id <Invalidation2> ObjB; // expected-note {{property declared here}}
+@property (readonly, strong) id <Invalidation2> ObjB;
@end
@interface Parent : NSObject <IDEBuildable, Invalidation2> {
}
@end
-@implementation Child // expected-warning {{auto property synthesis will not synthesize property 'ObjB' declared in protocol 'IDEBuildable'}}
+@implementation Child
- (void)invalidate{
// no-warning
}
@end
@protocol TopProtocol
- @property (readonly) id myString; // expected-note {{property declared here}}
+ @property (readonly) id myString;
@end
@interface TopClass <TopProtocol>
@interface SubClass : TopClass <TopProtocol>
@end
-@implementation SubClass @end // expected-warning {{auto property synthesis will not synthesize property 'myString' declared in protocol 'TopProtocol'}}
+@implementation SubClass @end
// rdar://7920807
@interface C @end
@implementation TimeZoneManager
@end
+
+// rdar://18179833
+@protocol BaseProt
+@property (assign) id prot;
+@end
+
+@interface Base<BaseProt>
+@end
+
+@interface I : Base<BaseProt>
+@end
+
+@implementation I
+@end