]> granicus.if.org Git - clang/commitdiff
Don't define __has_feature(objc_fixed_enum) in non-objc mode
authorErik Pilkington <erik.pilkington@gmail.com>
Wed, 30 Jan 2019 21:14:08 +0000 (21:14 +0000)
committerErik Pilkington <erik.pilkington@gmail.com>
Wed, 30 Jan 2019 21:14:08 +0000 (21:14 +0000)
This is only a formal language feature in ObjC, otherwise its just an
extension. Making this change was also an ABI break.

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

include/clang/Basic/Features.def
test/SemaObjC/enum-fixed-type.m

index 3230a1d3244f2443e9f86b1b8ef22ff1a25d1cf6..8fc4e5a6b9a30a72623fc1fb956084f64c0e4b3b 100644 (file)
@@ -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)
index 88c895a33982d2f6dc376fd7cd48af8893cab660..b4135a555a23eca86500becbcc36f785de725ae4 100644 (file)
@@ -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