diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2009-11-02 18:45:36 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2009-11-02 18:45:36 +0000 |
commit | ec344ed2f52390f5fbdfe2e5d840e34591583a84 (patch) | |
tree | 0a7b593c80c1ca0a03d47358a27e9255c75dc7c6 /clang/lib/Sema/SemaDeclObjC.cpp | |
parent | a38a4dfea798312e0ec7a4f803932e2931e68b30 (diff) | |
download | bcm5719-llvm-ec344ed2f52390f5fbdfe2e5d840e34591583a84.tar.gz bcm5719-llvm-ec344ed2f52390f5fbdfe2e5d840e34591583a84.zip |
Diagnose implementation of a property declared in a category
in its class implementation instead of crashing. Fixes radar 7350345.
llvm-svn: 85813
Diffstat (limited to 'clang/lib/Sema/SemaDeclObjC.cpp')
-rw-r--r-- | clang/lib/Sema/SemaDeclObjC.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaDeclObjC.cpp b/clang/lib/Sema/SemaDeclObjC.cpp index d1b68a79775..881652f7aaa 100644 --- a/clang/lib/Sema/SemaDeclObjC.cpp +++ b/clang/lib/Sema/SemaDeclObjC.cpp @@ -2047,6 +2047,14 @@ Sema::DeclPtrTy Sema::ActOnPropertyImplDecl(SourceLocation AtLoc, Diag(PropertyLoc, diag::error_bad_property_decl) << IDecl->getDeclName(); return DeclPtrTy(); } + if (const ObjCCategoryDecl *CD = + dyn_cast<ObjCCategoryDecl>(property->getDeclContext())) { + if (CD->getIdentifier()) { + Diag(PropertyLoc, diag::error_category_property) << CD->getDeclName(); + Diag(property->getLocation(), diag::note_category_property); + return DeclPtrTy(); + } + } } else if ((CatImplClass = dyn_cast<ObjCCategoryImplDecl>(ClassImpDecl))) { if (Synthesize) { Diag(AtLoc, diag::error_synthesize_category_decl); |