diff options
author | Hans Wennborg <hans@hanshq.net> | 2019-02-01 10:50:43 +0000 |
---|---|---|
committer | Hans Wennborg <hans@hanshq.net> | 2019-02-01 10:50:43 +0000 |
commit | 26f58c1748ca0ffcbf243e8ee9c925589575c81c (patch) | |
tree | ed591cbf401706fcb2c58b9bec62f3db1ebdb966 | |
parent | e10d57bc703c706c65620a25fc99479492a6a45a (diff) |
Merging r352672:
------------------------------------------------------------------------
r352672 | epilk | 2019-01-30 22:14:08 +0100 (Wed, 30 Jan 2019) | 4 lines
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/branches/release_80@352854 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | include/clang/Basic/Features.def | 2 | ||||
-rw-r--r-- | test/SemaObjC/enum-fixed-type.m | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/include/clang/Basic/Features.def b/include/clang/Basic/Features.def index 05464ed85f..8b3b59b51c 100644 --- a/include/clang/Basic/Features.def +++ b/include/clang/Basic/Features.def @@ -96,7 +96,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 |