summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorErik Pilkington <erik.pilkington@gmail.com>2019-01-30 21:14:08 +0000
committerErik Pilkington <erik.pilkington@gmail.com>2019-01-30 21:14:08 +0000
commit28a892b972f49a98c88e51a129872f117f305304 (patch)
treefeb867bb14dff09546893ea29fbbe5e6317cf0df
parent22457f8e9bd6e21d890134db2b268636cebd4591 (diff)
downloadbcm5719-llvm-28a892b972f49a98c88e51a129872f117f305304.tar.gz
bcm5719-llvm-28a892b972f49a98c88e51a129872f117f305304.zip
Don't define __has_feature(objc_fixed_enum) in non-objc mode
This is only a formal language feature in ObjC, otherwise its just an extension. Making this change was also an ABI break. llvm-svn: 352672
-rw-r--r--clang/include/clang/Basic/Features.def2
-rw-r--r--clang/test/SemaObjC/enum-fixed-type.m2
2 files changed, 3 insertions, 1 deletions
diff --git a/clang/include/clang/Basic/Features.def b/clang/include/clang/Basic/Features.def
index 3230a1d3244..8fc4e5a6b9a 100644
--- a/clang/include/clang/Basic/Features.def
+++ b/clang/include/clang/Basic/Features.def
@@ -95,7 +95,7 @@ FEATURE(objc_arc, LangOpts.ObjCAutoRefCount)
FEATURE(objc_arc_fields, true)
FEATURE(objc_arc_weak, LangOpts.ObjCWeak)
FEATURE(objc_default_synthesize_properties, LangOpts.ObjC)
-FEATURE(objc_fixed_enum, true)
+FEATURE(objc_fixed_enum, LangOpts.ObjC)
FEATURE(objc_instancetype, LangOpts.ObjC)
FEATURE(objc_kindof, LangOpts.ObjC)
FEATURE(objc_modules, LangOpts.ObjC && LangOpts.Modules)
diff --git a/clang/test/SemaObjC/enum-fixed-type.m b/clang/test/SemaObjC/enum-fixed-type.m
index 88c895a3398..b4135a555a2 100644
--- a/clang/test/SemaObjC/enum-fixed-type.m
+++ b/clang/test/SemaObjC/enum-fixed-type.m
@@ -1,9 +1,11 @@
// RUN: %clang_cc1 -fsyntax-only -pedantic -verify %s
// RUN: %clang_cc1 -fsyntax-only -verify -xc %s
+#ifdef __OBJC__
#if !__has_feature(objc_fixed_enum)
# error Enumerations with a fixed underlying type are not supported
#endif
+#endif
#if !__has_extension(cxx_fixed_enum)
# error Enumerations with a fixed underlying type are not supported
OpenPOWER on IntegriCloud