Author: fjahanian
Date: Thu Apr 29 12:52:18 2010
New Revision: 102645

URL: http://llvm.org/viewvc/llvm-project?rev=102645&view=rev
Log:
Properties cannot be synthesized by-dafult in
categories. Issue usual warnings instead of
confusing error message. Radar 7920807


Modified:
    cfe/trunk/lib/Sema/SemaObjCProperty.cpp
    cfe/trunk/test/SemaObjC/default-synthesize.m

Modified: cfe/trunk/lib/Sema/SemaObjCProperty.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaObjCProperty.cpp?rev=102645&r1=102644&r2=102645&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaObjCProperty.cpp (original)
+++ cfe/trunk/lib/Sema/SemaObjCProperty.cpp Thu Apr 29 12:52:18 2010
@@ -810,7 +810,7 @@
         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),

Modified: cfe/trunk/test/SemaObjC/default-synthesize.m
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjC/default-synthesize.m?rev=102645&r1=102644&r2=102645&view=diff
==============================================================================
--- cfe/trunk/test/SemaObjC/default-synthesize.m (original)
+++ cfe/trunk/test/SemaObjC/default-synthesize.m Thu Apr 29 12:52:18 2010
@@ -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
+


_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to