]> granicus.if.org Git - clang/commitdiff
Properties cannot be synthesized by-dafult in
authorFariborz Jahanian <fjahanian@apple.com>
Thu, 29 Apr 2010 17:52:18 +0000 (17:52 +0000)
committerFariborz Jahanian <fjahanian@apple.com>
Thu, 29 Apr 2010 17:52:18 +0000 (17:52 +0000)
categories. Issue usual warnings instead of
confusing error message. Radar 7920807

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102645 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaObjCProperty.cpp
test/SemaObjC/default-synthesize.m

index 1d27e44dbe749889e054a411eb566687c953330a..13c75e4fe960776ef4a7b84ac7e828c31fcc6191 100644 (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),
index b892dfadf4f8636b11e0281228e93293b6827d42..21453d38414589b66f777a4c2061965fff568786 100644 (file)
 @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
+