[cfe-commits] r65973 - in /cfe/trunk: lib/Sema/SemaDeclObjC.cpp test/SemaObjC/property-nonfragile-abi.m

Steve Naroff snaroff at apple.com
Tue Mar 3 14:09:41 PST 2009


Author: snaroff
Date: Tue Mar  3 16:09:41 2009
New Revision: 65973

URL: http://llvm.org/viewvc/llvm-project?rev=65973&view=rev
Log:
Fix <rdar://problem/5982579> [clang on xcode] (using arch=x86_64): synthesized property 'sdkPath' must either be named the same as a compatible ivar or must explicitly name an ivar.

Added:
    cfe/trunk/test/SemaObjC/property-nonfragile-abi.m
Modified:
    cfe/trunk/lib/Sema/SemaDeclObjC.cpp

Modified: cfe/trunk/lib/Sema/SemaDeclObjC.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDeclObjC.cpp?rev=65973&r1=65972&r2=65973&view=diff

==============================================================================
--- cfe/trunk/lib/Sema/SemaDeclObjC.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDeclObjC.cpp Tue Mar  3 16:09:41 2009
@@ -1734,7 +1734,8 @@
     // Check that this is a previously declared 'ivar' in 'IDecl' interface
     Ivar = IDecl->lookupInstanceVariable(PropertyIvar);
     if (!Ivar) {
-      Diag(PropertyLoc, diag::error_missing_property_ivar_decl) << PropertyId;
+      if (!getLangOptions().ObjCNonFragileABI)
+        Diag(PropertyLoc, diag::error_missing_property_ivar_decl) << PropertyId;
       return 0;
     }
     QualType PropType = Context.getCanonicalType(property->getType());

Added: cfe/trunk/test/SemaObjC/property-nonfragile-abi.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjC/property-nonfragile-abi.m?rev=65973&view=auto

==============================================================================
--- cfe/trunk/test/SemaObjC/property-nonfragile-abi.m (added)
+++ cfe/trunk/test/SemaObjC/property-nonfragile-abi.m Tue Mar  3 16:09:41 2009
@@ -0,0 +1,22 @@
+// RUN: clang -fsyntax-only -arch x86_64 -verify %s 
+
+typedef signed char BOOL;
+
+ at class NSInvocation, NSMethodSignature, NSCoder, NSString, NSEnumerator;
+
+ at protocol NSObject
+- (BOOL)isEqual:(id)object;
+ at end
+
+ at interface NSObject <NSObject> {}
+ at end
+
+ at interface XCDeviceWillExecuteInfoBaton : NSObject {}
+  @property (retain) __attribute__((objc_gc(strong))) NSString *sdkPath;
+ at end
+
+ at implementation XCDeviceWillExecuteInfoBaton
+  // No error is produced with compiling for -arch x86_64 (or "non-fragile" ABI)
+  @synthesize sdkPath;
+ at end
+





More information about the cfe-commits mailing list