diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2012-02-02 00:15:51 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2012-02-02 00:15:51 +0000 |
commit | ccded6e44731dec951bbceda655dcae88380191b (patch) | |
tree | 81df8fe34a6423b181f5c24ffdd4fb2abc963b17 | |
parent | 43484c5cd7b0654d7812a1b486f2733a593d7966 (diff) | |
download | bcm5719-llvm-ccded6e44731dec951bbceda655dcae88380191b.tar.gz bcm5719-llvm-ccded6e44731dec951bbceda655dcae88380191b.zip |
objc2: add __has_feature(objc_default_synthesize_properties).
// rdar://10770497
llvm-svn: 149565
-rw-r--r-- | clang/lib/Lex/PPMacroExpansion.cpp | 1 | ||||
-rw-r--r-- | clang/test/SemaObjC/default-synthesize.m | 18 |
2 files changed, 15 insertions, 4 deletions
diff --git a/clang/lib/Lex/PPMacroExpansion.cpp b/clang/lib/Lex/PPMacroExpansion.cpp index d8cd4403916..8793ff5ac9a 100644 --- a/clang/lib/Lex/PPMacroExpansion.cpp +++ b/clang/lib/Lex/PPMacroExpansion.cpp @@ -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) diff --git a/clang/test/SemaObjC/default-synthesize.m b/clang/test/SemaObjC/default-synthesize.m index d608ded97a2..b4ae0de7151 100644 --- a/clang/test/SemaObjC/default-synthesize.m +++ b/clang/test/SemaObjC/default-synthesize.m @@ -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; @@ -112,7 +120,9 @@ @implementation D - (int) Meth { return self.PROP; } +#if __has_feature(objc_default_synthesize_properties) @synthesize PROP=IVAR; +#endif @end // rdar://10567333 |