diff options
-rw-r--r-- | lib/Sema/SemaObjCProperty.cpp | 3 | ||||
-rw-r--r-- | test/SemaObjC/unimplemented-protocol-prop.m | 18 |
2 files changed, 20 insertions, 1 deletions
diff --git a/lib/Sema/SemaObjCProperty.cpp b/lib/Sema/SemaObjCProperty.cpp index db23c84f2e..56aa4480fb 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 0805202c5e..fa3ed8ef12 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 + |