diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2014-07-26 20:52:26 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2014-07-26 20:52:26 +0000 |
commit | 4ab2452c1f5294a96120164bf4b0b5b95e2d141a (patch) | |
tree | 2439a295a5050baf0420f78036fb18a166e9e259 /lib/Sema/SemaObjCProperty.cpp | |
parent | 917ace5cf50494106a76000f9a2f32b6dd37effd (diff) |
Objective-C. Issue more warning diagnostic when certain
properties are not synthesized in property auto-synthesis,
as it can potentiall lead to runtime errors.
rdar://17774815
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@214032 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaObjCProperty.cpp')
-rw-r--r-- | lib/Sema/SemaObjCProperty.cpp | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/lib/Sema/SemaObjCProperty.cpp b/lib/Sema/SemaObjCProperty.cpp index 8eb806ba30..0032294926 100644 --- a/lib/Sema/SemaObjCProperty.cpp +++ b/lib/Sema/SemaObjCProperty.cpp @@ -1555,20 +1555,23 @@ void Sema::DefaultSynthesizeProperties(Scope *S, ObjCImplDecl* IMPDecl, ObjCPropertyDecl::OBJC_PR_readonly) && !IMPDecl->getInstanceMethod(Prop->getSetterName()) && !IDecl->HasUserDeclaredSetterMethod(Prop)) { - Diag(Prop->getLocation(), diag::warn_no_autosynthesis_property) - << Prop->getIdentifier(); - Diag(PropInSuperClass->getLocation(), diag::note_property_declare); + Diag(Prop->getLocation(), diag::warn_no_autosynthesis_property) + << Prop->getIdentifier(); + Diag(PropInSuperClass->getLocation(), diag::note_property_declare); + } + else { + Diag(Prop->getLocation(), diag::warn_autosynthesis_property_in_superclass) + << Prop->getIdentifier(); + Diag(IMPDecl->getLocation(), diag::note_while_in_implementation); } continue; } if (ObjCPropertyImplDecl *PID = IMPDecl->FindPropertyImplIvarDecl(Prop->getIdentifier())) { - if (PID->getPropertyDecl() != Prop) { - Diag(Prop->getLocation(), diag::warn_no_autosynthesis_shared_ivar_property) - << Prop->getIdentifier(); - if (!PID->getLocation().isInvalid()) - Diag(PID->getLocation(), diag::note_property_synthesize); - } + Diag(Prop->getLocation(), diag::warn_no_autosynthesis_shared_ivar_property) + << Prop->getIdentifier(); + if (!PID->getLocation().isInvalid()) + Diag(PID->getLocation(), diag::note_property_synthesize); continue; } if (ObjCProtocolDecl *Proto = |