aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaObjCProperty.cpp
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2013-03-21 20:50:53 +0000
committerFariborz Jahanian <fjahanian@apple.com>2013-03-21 20:50:53 +0000
commit5bdaef55d486f20346fe16f3d41324694d3ff0d5 (patch)
tree42f23dd26e4435d342050b93736733695df10001 /lib/Sema/SemaObjCProperty.cpp
parentcf4bd50c56ece266060bb759351a62251abd16ee (diff)
Objective-C: Tighten the rules when warning
is issused for on overriding 'readwrite' property which is not auto-synthesized. Buttom line is that if hueristics determine that there will be a user implemented setter, no warning will be issued. // rdar://13388503 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177662 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaObjCProperty.cpp')
-rw-r--r--lib/Sema/SemaObjCProperty.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Sema/SemaObjCProperty.cpp b/lib/Sema/SemaObjCProperty.cpp
index aae8ae6e33..121ed8cbb5 100644
--- a/lib/Sema/SemaObjCProperty.cpp
+++ b/lib/Sema/SemaObjCProperty.cpp
@@ -1590,7 +1590,8 @@ void Sema::DefaultSynthesizeProperties(Scope *S, ObjCImplDecl* IMPDecl,
if ((Prop->getPropertyAttributes() & ObjCPropertyDecl::OBJC_PR_readwrite) &&
(PropInSuperClass->getPropertyAttributes() &
ObjCPropertyDecl::OBJC_PR_readonly) &&
- !IMPDecl->getInstanceMethod(Prop->getSetterName())) {
+ !IMPDecl->getInstanceMethod(Prop->getSetterName()) &&
+ !IDecl->HasUserDeclaredSetterMethod(Prop)) {
Diag(Prop->getLocation(), diag::warn_no_autosynthesis_property)
<< Prop->getIdentifier()->getName();
Diag(PropInSuperClass->getLocation(), diag::note_property_declare);