summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaObjCProperty.cpp
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2014-07-26 20:52:26 +0000
committerFariborz Jahanian <fjahanian@apple.com>2014-07-26 20:52:26 +0000
commit6c9ee7b0c8560250fcc0c023529ec9753851729a (patch)
tree9be385d5afde0f6bda9f8ac4b19c7d0b3888393b /clang/lib/Sema/SemaObjCProperty.cpp
parent31bde322f374582d7106f0c847b0ff3b6b6d705b (diff)
downloadbcm5719-llvm-6c9ee7b0c8560250fcc0c023529ec9753851729a.tar.gz
bcm5719-llvm-6c9ee7b0c8560250fcc0c023529ec9753851729a.zip
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 llvm-svn: 214032
Diffstat (limited to 'clang/lib/Sema/SemaObjCProperty.cpp')
-rw-r--r--clang/lib/Sema/SemaObjCProperty.cpp21
1 files changed, 12 insertions, 9 deletions
diff --git a/clang/lib/Sema/SemaObjCProperty.cpp b/clang/lib/Sema/SemaObjCProperty.cpp
index 8eb806ba301..00322949261 100644
--- a/clang/lib/Sema/SemaObjCProperty.cpp
+++ b/clang/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 =
OpenPOWER on IntegriCloud