From: Erik Pilkington Date: Wed, 30 Jan 2019 21:14:08 +0000 (+0000) Subject: Don't define __has_feature(objc_fixed_enum) in non-objc mode X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=39f4e5b50e00628214a683c8b499a57d4ee3571a;p=clang 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@352672 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/Basic/Features.def b/include/clang/Basic/Features.def index 3230a1d324..8fc4e5a6b9 100644 --- a/include/clang/Basic/Features.def +++ b/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/test/SemaObjC/enum-fixed-type.m b/test/SemaObjC/enum-fixed-type.m index 88c895a339..b4135a555a 100644 --- a/test/SemaObjC/enum-fixed-type.m +++ b/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