summaryrefslogtreecommitdiffstats
path: root/clang
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2011-09-27 00:23:52 +0000
committerFariborz Jahanian <fjahanian@apple.com>2011-09-27 00:23:52 +0000
commit698bd3113e079624143bd3841c76e5567bf1d7b7 (patch)
tree294df96598192eaebe40fc3785258b176c525d6f /clang
parentf6fbfd3f83f7c3be8dca6f0767d73c53b51d5d69 (diff)
downloadbcm5719-llvm-698bd3113e079624143bd3841c76e5567bf1d7b7.tar.gz
bcm5719-llvm-698bd3113e079624143bd3841c76e5567bf1d7b7.zip
objc - don't complain about unimplemented property when conforming
protocol declares the property, as well as one of its superclasses. Property will be implemented in the super class. // rdar://10120691 llvm-svn: 140586
Diffstat (limited to 'clang')
-rw-r--r--clang/lib/Sema/SemaObjCProperty.cpp3
-rw-r--r--clang/test/SemaObjC/unimplemented-protocol-prop.m18
2 files changed, 20 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaObjCProperty.cpp b/clang/lib/Sema/SemaObjCProperty.cpp
index db23c84f2e2..56aa4480fbe 100644
--- a/clang/lib/Sema/SemaObjCProperty.cpp
+++ b/clang/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/clang/test/SemaObjC/unimplemented-protocol-prop.m b/clang/test/SemaObjC/unimplemented-protocol-prop.m
index 0805202c5e0..fa3ed8ef121 100644
--- a/clang/test/SemaObjC/unimplemented-protocol-prop.m
+++ b/clang/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
+
OpenPOWER on IntegriCloud