summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2014-08-29 20:29:31 +0000
committerFariborz Jahanian <fjahanian@apple.com>2014-08-29 20:29:31 +0000
commit3b230089877eaf44ae1452afe358d85b0538db46 (patch)
tree32c29c6ea9ab9ac2b65ea3804075f5ef6702935a /clang/lib/Sema
parent5ce0ce44301c23fff7ac9b631c2b68ae23b29298 (diff)
downloadbcm5719-llvm-3b230089877eaf44ae1452afe358d85b0538db46.tar.gz
bcm5719-llvm-3b230089877eaf44ae1452afe358d85b0538db46.zip
Objective-C [qoi]. If property is going to be implemented
in the super class, do not issue the warning about property in current class's protocol will not be auto synthesized. // rdar://18179833 llvm-svn: 216769
Diffstat (limited to 'clang/lib/Sema')
-rw-r--r--clang/lib/Sema/SemaObjCProperty.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/clang/lib/Sema/SemaObjCProperty.cpp b/clang/lib/Sema/SemaObjCProperty.cpp
index ba698c1b3c3..cf9010f7fe0 100644
--- a/clang/lib/Sema/SemaObjCProperty.cpp
+++ b/clang/lib/Sema/SemaObjCProperty.cpp
@@ -1555,12 +1555,14 @@ void Sema::DefaultSynthesizeProperties(Scope *S, ObjCImplDecl* IMPDecl,
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;
@@ -1569,8 +1571,7 @@ void Sema::DefaultSynthesizeProperties(Scope *S, ObjCImplDecl* IMPDecl,
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) &&
OpenPOWER on IntegriCloud