[cfe-commits] r102645 - in /cfe/trunk: lib/Sema/SemaObjCProperty.cpp test/SemaObjC/default-synthesize.m

Fariborz Jahanian fjahanian at apple.com
Thu Apr 29 10:52:18 PDT 2010


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
+ at interface C @end
+ at interface C (Category)
+ at property int p; // expected-warning {{property 'p' requires method 'p' to be defined }} \
+                 // expected-warning {{property 'p' requires method 'setP:' to be defined}}
+ at end
+ at implementation C (Category) // expected-note 2 {{implementation is here}}
+ at end
+





More information about the cfe-commits mailing list