]> granicus.if.org Git - clang/commitdiff
objc2: add __has_feature(objc_default_synthesize_properties).
authorFariborz Jahanian <fjahanian@apple.com>
Thu, 2 Feb 2012 00:15:51 +0000 (00:15 +0000)
committerFariborz Jahanian <fjahanian@apple.com>
Thu, 2 Feb 2012 00:15:51 +0000 (00:15 +0000)
// rdar://10770497

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149565 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Lex/PPMacroExpansion.cpp
test/SemaObjC/default-synthesize.m

index d8cd440391695e554e76167b735a197dffba2e05..8793ff5ac9a9fc631e6dbc91bb237c176b2bb67b 100644 (file)
@@ -616,6 +616,7 @@ static bool HasFeature(const Preprocessor &PP, const IdentifierInfo *II) {
            .Case("objc_arc", LangOpts.ObjCAutoRefCount)
            .Case("objc_arc_weak", LangOpts.ObjCAutoRefCount && 
                  LangOpts.ObjCRuntimeHasWeak)
+           .Case("objc_default_synthesize_properties", LangOpts.ObjC2)
            .Case("objc_fixed_enum", LangOpts.ObjC2)
            .Case("objc_instancetype", LangOpts.ObjC2)
            .Case("objc_modules", LangOpts.ObjC2 && LangOpts.Modules)
index d608ded97a2d74f8f880f0d42166f3e673d724c5..b4ae0de71510a3579acd420420ddf71fd007381c 100644 (file)
@@ -10,7 +10,9 @@
 @end
 
 @implementation SynthItAll
-//@synthesize howMany, what;
+#if !__has_feature(objc_default_synthesize_properties)
+@synthesize howMany, what;
+#endif
 @end
 
 
@@ -20,7 +22,9 @@
 @end
 
 @implementation SynthSetter
-//@synthesize howMany, what;
+#if !__has_feature(objc_default_synthesize_properties)
+@synthesize howMany, what;
+#endif
 
 - (int) howMany {
     return self.howMany;
@@ -40,7 +44,9 @@
 @end
 
 @implementation SynthGetter
-//@synthesize howMany, what;
+#if !__has_feature(objc_default_synthesize_properties)
+@synthesize howMany, what;
+#endif
 
 // - (int) howMany
 - (void) setHowMany: (int) value {
@@ -61,7 +67,9 @@
 @end
 
 @implementation SynthNone
-//@synthesize howMany, what;  // REM: Redundant anyway
+#if !__has_feature(objc_default_synthesize_properties)
+@synthesize howMany, what;  // REM: Redundant anyway
+#endif
 
 - (int) howMany {
     return self.howMany;
 
 @implementation D
 - (int) Meth { return self.PROP; }
+#if __has_feature(objc_default_synthesize_properties)
 @synthesize PROP=IVAR;
+#endif
 @end
 
 // rdar://10567333