Properties cannot be synthesized by-dafult in

categories. Issue usual warnings instead of
confusing error message. Radar 7920807

llvm-svn: 102645
This commit is contained in:
Fariborz Jahanian 2010-04-29 17:52:18 +00:00
parent dfcd0661a1
commit 9e1a3af030
2 changed files with 11 additions and 1 deletions

View File

@ -810,7 +810,7 @@ void Sema::DiagnoseUnimplementedProperties(ObjCImplDecl* IMPDecl,
Prop->getPropertyImplementation() == ObjCPropertyDecl::Optional ||
PropImplMap.count(Prop))
continue;
if (LangOpts.ObjCNonFragileABI2) {
if (LangOpts.ObjCNonFragileABI2 && !isa<ObjCCategoryImplDecl>(IMPDecl)) {
ActOnPropertyImplDecl(IMPDecl->getLocation(),
IMPDecl->getLocation(),
true, DeclPtrTy::make(IMPDecl),

View File

@ -93,3 +93,13 @@
@end
@implementation SubClass @end // expected-error {{property 'myString' attempting to use ivar 'myString' declared in super class 'TopClass'}}
// rdar: // 7920807
@interface C @end
@interface C (Category)
@property int p; // expected-warning {{property 'p' requires method 'p' to be defined }} \
// expected-warning {{property 'p' requires method 'setP:' to be defined}}
@end
@implementation C (Category) // expected-note 2 {{implementation is here}}
@end