aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaObjCProperty.cpp
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2012-05-03 16:43:30 +0000
committerFariborz Jahanian <fjahanian@apple.com>2012-05-03 16:43:30 +0000
commit975eef64182a78d1afc0f3da8cba4cb961cda5e4 (patch)
tree6a2f80f30340e85c6128d841e39ad315920689fa /lib/Sema/SemaObjCProperty.cpp
parent0cf3c0eecbff007cea2750c113894b47d9e09f33 (diff)
objective-c: warn for properties being default synthesized
under -Wobjc-missing-property-synthesis which must be opted-in. // rdar://11295716 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156078 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaObjCProperty.cpp')
-rw-r--r--lib/Sema/SemaObjCProperty.cpp15
1 files changed, 10 insertions, 5 deletions
diff --git a/lib/Sema/SemaObjCProperty.cpp b/lib/Sema/SemaObjCProperty.cpp
index 0ae2a21495..9f9c96046a 100644
--- a/lib/Sema/SemaObjCProperty.cpp
+++ b/lib/Sema/SemaObjCProperty.cpp
@@ -1420,11 +1420,16 @@ void Sema::DefaultSynthesizeProperties(Scope *S, ObjCImplDecl* IMPDecl,
// aren't really synthesized at a particular location; they just exist.
// Saying that they are located at the @implementation isn't really going
// to help users.
- ActOnPropertyImplDecl(S, SourceLocation(), SourceLocation(),
- true,
- /* property = */ Prop->getIdentifier(),
- /* ivar = */ getDefaultSynthIvarName(Prop, Context),
- SourceLocation());
+ ObjCPropertyImplDecl *PIDecl = dyn_cast_or_null<ObjCPropertyImplDecl>(
+ ActOnPropertyImplDecl(S, SourceLocation(), SourceLocation(),
+ true,
+ /* property = */ Prop->getIdentifier(),
+ /* ivar = */ getDefaultSynthIvarName(Prop, Context),
+ SourceLocation()));
+ if (PIDecl) {
+ Diag(Prop->getLocation(), diag::warn_missing_explicit_synthesis);
+ Diag(IMPDecl->getLocation(), diag::not_while_in_implementation);
+ }
}
}