aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaObjCProperty.cpp
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2011-07-22 01:06:53 +0000
committerFariborz Jahanian <fjahanian@apple.com>2011-07-22 01:06:53 +0000
commit527eec86ce96695a7198073e574bf4a184848d24 (patch)
tree6e5e1cadc7018513d5aab0263a9e1d53a81a5ea1 /lib/Sema/SemaObjCProperty.cpp
parent393f249399fe30e9580e1529a7479489e90f3a57 (diff)
objective-c: Any use of @synthesize or @dynamic lexically after a method (or C function) implementation
will be rejected with a compilation error in ARC mode, and a compiler warning otherwise. This may cause breakage in non-arc (and arc) tests which don't expect warning/error. Feel free to fix the tests, or reverse the patch, if I am unavailable. // rdar://9818354 - WIP git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135740 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaObjCProperty.cpp')
-rw-r--r--lib/Sema/SemaObjCProperty.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/Sema/SemaObjCProperty.cpp b/lib/Sema/SemaObjCProperty.cpp
index d826ea8d84..53de50c16c 100644
--- a/lib/Sema/SemaObjCProperty.cpp
+++ b/lib/Sema/SemaObjCProperty.cpp
@@ -555,6 +555,14 @@ Decl *Sema::ActOnPropertyImplDecl(Scope *S,
return 0;
}
}
+ if ((IC->meth_begin() != IC->meth_end()) && AtLoc.isValid()) {
+ if (getLangOptions().ObjCAutoRefCount)
+ Diag(AtLoc, diag::error_property_after_method_impl);
+ else
+ Diag(AtLoc, diag::warn_property_after_method_impl);
+ ObjCMethodDecl *method = *(IC->meth_begin());
+ Diag(method->getLocation(), diag::note_method_declared_at);
+ }
} else if ((CatImplClass = dyn_cast<ObjCCategoryImplDecl>(ClassImpDecl))) {
if (Synthesize) {
Diag(AtLoc, diag::error_synthesize_category_decl);