aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaObjCProperty.cpp
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2011-12-15 01:03:18 +0000
committerFariborz Jahanian <fjahanian@apple.com>2011-12-15 01:03:18 +0000
commitf8aba8c618920db8f6ef2db0c554b0c270503cef (patch)
treecbcecd19dc1ba450b7a50ab275850429d9d6413c /lib/Sema/SemaObjCProperty.cpp
parent5e3a8bea1cb3a8508a99982278934df32ccc7387 (diff)
objc: do not auto synthesize properties declared in
protocols; with a warning. // rdar://10567333 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146626 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaObjCProperty.cpp')
-rw-r--r--lib/Sema/SemaObjCProperty.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/Sema/SemaObjCProperty.cpp b/lib/Sema/SemaObjCProperty.cpp
index 7436745ad9..c60d1b8f5e 100644
--- a/lib/Sema/SemaObjCProperty.cpp
+++ b/lib/Sema/SemaObjCProperty.cpp
@@ -1328,7 +1328,13 @@ void Sema::DefaultSynthesizeProperties(Scope *S, ObjCImplDecl* IMPDecl,
if (IMPDecl->getInstanceMethod(Prop->getSetterName()))
continue;
}
-
+ if (isa<ObjCProtocolDecl>(Prop->getDeclContext())) {
+ // We won't auto-synthesize properties declared in protocols.
+ Diag(IMPDecl->getLocation(),
+ diag::warn_auto_synthesizing_protocol_property);
+ Diag(Prop->getLocation(), diag::note_property_declare);
+ continue;
+ }
// We use invalid SourceLocations for the synthesized ivars since they
// aren't really synthesized at a particular location; they just exist.