diff --git a/lib/Sema/SemaObjCProperty.cpp b/lib/Sema/SemaObjCProperty.cpp index db23c84f2e20c8e9683e798e6fcb4cb7732bdfb3..56aa4480fbe669f325b136bde0e6bf025eb6e4f7 100644 --- a/lib/Sema/SemaObjCProperty.cpp +++ b/lib/Sema/SemaObjCProperty.cpp @@ -1153,7 +1153,8 @@ void Sema::CollectImmediateProperties(ObjCContainerDecl *CDecl, ObjCPropertyDecl *PropertyFromSuper = SuperPropMap[Prop->getIdentifier()]; // Exclude property for protocols which conform to class's super-class, // as super-class has to implement the property. - if (!PropertyFromSuper || PropertyFromSuper != Prop) { + if (!PropertyFromSuper || + PropertyFromSuper->getIdentifier() != Prop->getIdentifier()) { ObjCPropertyDecl *&PropEntry = PropMap[Prop->getIdentifier()]; if (!PropEntry) PropEntry = Prop; diff --git a/test/SemaObjC/unimplemented-protocol-prop.m b/test/SemaObjC/unimplemented-protocol-prop.m index 0805202c5e09203a1b9f5bf946c3f0c47b5c1e4b..fa3ed8ef121c7f6bfb4cb20d7e4fefa05f34e5b6 100644 --- a/test/SemaObjC/unimplemented-protocol-prop.m +++ b/test/SemaObjC/unimplemented-protocol-prop.m @@ -19,3 +19,21 @@ // expected-warning {{property 'MyProperty0' requires method 'setMyProperty0:' to be defined}}\ // expected-warning {{property 'MyProperty' requires method 'MyProperty' to be defined}} \ // expected-warning {{property 'MyProperty' requires method 'setMyProperty:' to be defined}} + +// rdar://10120691 +// property is implemented in super class. No warning + +@protocol PROTOCOL1 +@property int MyProp; +@end + +@interface superclass +@property int MyProp; +@end + +@interface childclass : superclass <PROTOCOL1> +@end + +@implementation childclass +@end +