diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2011-07-22 01:06:53 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2011-07-22 01:06:53 +0000 |
commit | dff8de77a611f93712df6bcfb54c2e0bed599f02 (patch) | |
tree | c7e29d982511a550f3f3714961fc14ecfef6e3a3 /clang/lib/Sema/SemaObjCProperty.cpp | |
parent | 959b7e9df7e0ee11dc17297bddf7ed88b43ef425 (diff) | |
download | bcm5719-llvm-dff8de77a611f93712df6bcfb54c2e0bed599f02.tar.gz bcm5719-llvm-dff8de77a611f93712df6bcfb54c2e0bed599f02.zip |
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
llvm-svn: 135740
Diffstat (limited to 'clang/lib/Sema/SemaObjCProperty.cpp')
-rw-r--r-- | clang/lib/Sema/SemaObjCProperty.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaObjCProperty.cpp b/clang/lib/Sema/SemaObjCProperty.cpp index d826ea8d84a..53de50c16cf 100644 --- a/clang/lib/Sema/SemaObjCProperty.cpp +++ b/clang/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); |