From a4f0764aefd6ea41e83a5974f582a1a7e985667d Mon Sep 17 00:00:00 2001 From: Mark de Wever Date: Sun, 18 Jun 2023 12:35:44 +0200 Subject: [PATCH] [libc++] Marks __cpp_lib_bitops as implemented. This FTM was introduced in P0553R4 Bit operations Which has been implemented since libc++ 9. This was noticed while working on D153192. Reviewed By: #libc, philnik Differential Revision: https://reviews.llvm.org/D153225 --- libcxx/docs/FeatureTestMacroTable.rst | 2 +- libcxx/include/version | 2 +- .../bit.version.compile.pass.cpp | 48 +++++++--------------- .../version.version.compile.pass.cpp | 48 +++++++--------------- .../generate_feature_test_macro_components.py | 1 - 5 files changed, 32 insertions(+), 69 deletions(-) diff --git a/libcxx/docs/FeatureTestMacroTable.rst b/libcxx/docs/FeatureTestMacroTable.rst index 45e580f..4c8e1ff 100644 --- a/libcxx/docs/FeatureTestMacroTable.rst +++ b/libcxx/docs/FeatureTestMacroTable.rst @@ -192,7 +192,7 @@ Status --------------------------------------------------- ----------------- ``__cpp_lib_bit_cast`` ``201806L`` --------------------------------------------------- ----------------- - ``__cpp_lib_bitops`` *unimplemented* + ``__cpp_lib_bitops`` ``201907L`` --------------------------------------------------- ----------------- ``__cpp_lib_bounded_array_traits`` ``201902L`` --------------------------------------------------- ----------------- diff --git a/libcxx/include/version b/libcxx/include/version index 5f69eff..10abf69 100644 --- a/libcxx/include/version +++ b/libcxx/include/version @@ -332,7 +332,7 @@ __cpp_lib_within_lifetime 202306L # endif # define __cpp_lib_bind_front 201907L # define __cpp_lib_bit_cast 201806L -// # define __cpp_lib_bitops 201907L +# define __cpp_lib_bitops 201907L # define __cpp_lib_bounded_array_traits 201902L # if !defined(_LIBCPP_HAS_NO_CHAR8_T) # define __cpp_lib_char8_t 201907L diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/bit.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/bit.version.compile.pass.cpp index b858ff6..0e1d06b 100644 --- a/libcxx/test/std/language.support/support.limits/support.limits.general/bit.version.compile.pass.cpp +++ b/libcxx/test/std/language.support/support.limits/support.limits.general/bit.version.compile.pass.cpp @@ -101,17 +101,11 @@ # error "__cpp_lib_bit_cast should have the value 201806L in c++20" # endif -# if !defined(_LIBCPP_VERSION) -# ifndef __cpp_lib_bitops -# error "__cpp_lib_bitops should be defined in c++20" -# endif -# if __cpp_lib_bitops != 201907L -# error "__cpp_lib_bitops should have the value 201907L in c++20" -# endif -# else // _LIBCPP_VERSION -# ifdef __cpp_lib_bitops -# error "__cpp_lib_bitops should not be defined because it is unimplemented in libc++!" -# endif +# ifndef __cpp_lib_bitops +# error "__cpp_lib_bitops should be defined in c++20" +# endif +# if __cpp_lib_bitops != 201907L +# error "__cpp_lib_bitops should have the value 201907L in c++20" # endif # ifdef __cpp_lib_byteswap @@ -141,17 +135,11 @@ # error "__cpp_lib_bit_cast should have the value 201806L in c++23" # endif -# if !defined(_LIBCPP_VERSION) -# ifndef __cpp_lib_bitops -# error "__cpp_lib_bitops should be defined in c++23" -# endif -# if __cpp_lib_bitops != 201907L -# error "__cpp_lib_bitops should have the value 201907L in c++23" -# endif -# else // _LIBCPP_VERSION -# ifdef __cpp_lib_bitops -# error "__cpp_lib_bitops should not be defined because it is unimplemented in libc++!" -# endif +# ifndef __cpp_lib_bitops +# error "__cpp_lib_bitops should be defined in c++23" +# endif +# if __cpp_lib_bitops != 201907L +# error "__cpp_lib_bitops should have the value 201907L in c++23" # endif # ifndef __cpp_lib_byteswap @@ -184,17 +172,11 @@ # error "__cpp_lib_bit_cast should have the value 201806L in c++26" # endif -# if !defined(_LIBCPP_VERSION) -# ifndef __cpp_lib_bitops -# error "__cpp_lib_bitops should be defined in c++26" -# endif -# if __cpp_lib_bitops != 201907L -# error "__cpp_lib_bitops should have the value 201907L in c++26" -# endif -# else // _LIBCPP_VERSION -# ifdef __cpp_lib_bitops -# error "__cpp_lib_bitops should not be defined because it is unimplemented in libc++!" -# endif +# ifndef __cpp_lib_bitops +# error "__cpp_lib_bitops should be defined in c++26" +# endif +# if __cpp_lib_bitops != 201907L +# error "__cpp_lib_bitops should have the value 201907L in c++26" # endif # ifndef __cpp_lib_byteswap diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/version.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/version.version.compile.pass.cpp index dbad0e6..fb7081f 100644 --- a/libcxx/test/std/language.support/support.limits/support.limits.general/version.version.compile.pass.cpp +++ b/libcxx/test/std/language.support/support.limits/support.limits.general/version.version.compile.pass.cpp @@ -2846,17 +2846,11 @@ # error "__cpp_lib_bit_cast should have the value 201806L in c++20" # endif -# if !defined(_LIBCPP_VERSION) -# ifndef __cpp_lib_bitops -# error "__cpp_lib_bitops should be defined in c++20" -# endif -# if __cpp_lib_bitops != 201907L -# error "__cpp_lib_bitops should have the value 201907L in c++20" -# endif -# else // _LIBCPP_VERSION -# ifdef __cpp_lib_bitops -# error "__cpp_lib_bitops should not be defined because it is unimplemented in libc++!" -# endif +# ifndef __cpp_lib_bitops +# error "__cpp_lib_bitops should be defined in c++20" +# endif +# if __cpp_lib_bitops != 201907L +# error "__cpp_lib_bitops should have the value 201907L in c++20" # endif # ifdef __cpp_lib_bitset @@ -4127,17 +4121,11 @@ # error "__cpp_lib_bit_cast should have the value 201806L in c++23" # endif -# if !defined(_LIBCPP_VERSION) -# ifndef __cpp_lib_bitops -# error "__cpp_lib_bitops should be defined in c++23" -# endif -# if __cpp_lib_bitops != 201907L -# error "__cpp_lib_bitops should have the value 201907L in c++23" -# endif -# else // _LIBCPP_VERSION -# ifdef __cpp_lib_bitops -# error "__cpp_lib_bitops should not be defined because it is unimplemented in libc++!" -# endif +# ifndef __cpp_lib_bitops +# error "__cpp_lib_bitops should be defined in c++23" +# endif +# if __cpp_lib_bitops != 201907L +# error "__cpp_lib_bitops should have the value 201907L in c++23" # endif # ifdef __cpp_lib_bitset @@ -5615,17 +5603,11 @@ # error "__cpp_lib_bit_cast should have the value 201806L in c++26" # endif -# if !defined(_LIBCPP_VERSION) -# ifndef __cpp_lib_bitops -# error "__cpp_lib_bitops should be defined in c++26" -# endif -# if __cpp_lib_bitops != 201907L -# error "__cpp_lib_bitops should have the value 201907L in c++26" -# endif -# else // _LIBCPP_VERSION -# ifdef __cpp_lib_bitops -# error "__cpp_lib_bitops should not be defined because it is unimplemented in libc++!" -# endif +# ifndef __cpp_lib_bitops +# error "__cpp_lib_bitops should be defined in c++26" +# endif +# if __cpp_lib_bitops != 201907L +# error "__cpp_lib_bitops should have the value 201907L in c++26" # endif # if !defined(_LIBCPP_VERSION) diff --git a/libcxx/utils/generate_feature_test_macro_components.py b/libcxx/utils/generate_feature_test_macro_components.py index 72ae5bd..4d454f7 100755 --- a/libcxx/utils/generate_feature_test_macro_components.py +++ b/libcxx/utils/generate_feature_test_macro_components.py @@ -226,7 +226,6 @@ feature_test_macros = [ "name": "__cpp_lib_bitops", "values": {"c++20": 201907}, "headers": ["bit"], - "unimplemented": True, }, { "name": "__cpp_lib_bitset", -- 2.7.4