From: Steve Naroff Date: Tue, 3 Mar 2009 22:09:41 +0000 (+0000) Subject: Fix [clang on xcode] (using arch=x86_64): synthesized proper... X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f4c00ffdfdaacf0e3f664e5b535191a9efa1443a;p=clang Fix [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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65973 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Sema/SemaDeclObjC.cpp b/lib/Sema/SemaDeclObjC.cpp index 1ca9d8da9a..59278267cd 100644 --- a/lib/Sema/SemaDeclObjC.cpp +++ b/lib/Sema/SemaDeclObjC.cpp @@ -1734,7 +1734,8 @@ Sema::DeclTy *Sema::ActOnPropertyImplDecl(SourceLocation AtLoc, // 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()); diff --git a/test/SemaObjC/property-nonfragile-abi.m b/test/SemaObjC/property-nonfragile-abi.m new file mode 100644 index 0000000000..3dec8a8fd8 --- /dev/null +++ b/test/SemaObjC/property-nonfragile-abi.m @@ -0,0 +1,22 @@ +// RUN: clang -fsyntax-only -arch x86_64 -verify %s + +typedef signed char BOOL; + +@class NSInvocation, NSMethodSignature, NSCoder, NSString, NSEnumerator; + +@protocol NSObject +- (BOOL)isEqual:(id)object; +@end + +@interface NSObject {} +@end + +@interface XCDeviceWillExecuteInfoBaton : NSObject {} + @property (retain) __attribute__((objc_gc(strong))) NSString *sdkPath; +@end + +@implementation XCDeviceWillExecuteInfoBaton + // No error is produced with compiling for -arch x86_64 (or "non-fragile" ABI) + @synthesize sdkPath; +@end +