aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve Naroff <snaroff@apple.com>2009-03-03 22:09:41 +0000
committerSteve Naroff <snaroff@apple.com>2009-03-03 22:09:41 +0000
commitf4c00ffdfdaacf0e3f664e5b535191a9efa1443a (patch)
tree285efa5d65f3a0c3fb07c94e6cb1e90e9614b78c
parent94c969804b1f98650316a8f75434b2d24dbe94ea (diff)
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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65973 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Sema/SemaDeclObjC.cpp3
-rw-r--r--test/SemaObjC/property-nonfragile-abi.m22
2 files changed, 24 insertions, 1 deletions
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 <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
+