diff --git a/libcxx/docs/FeatureTestMacroTable.rst b/libcxx/docs/FeatureTestMacroTable.rst --- a/libcxx/docs/FeatureTestMacroTable.rst +++ b/libcxx/docs/FeatureTestMacroTable.rst @@ -20,7 +20,7 @@ .. table:: Current Status :name: feature-status-table :widths: auto - + ================================================= ================= Macro Name Value ================================================= ================= @@ -184,6 +184,8 @@ ------------------------------------------------- ----------------- ``__cpp_lib_destroying_delete`` ``201806L`` ------------------------------------------------- ----------------- + ``__cpp_lib_endian`` ``201907L`` + ------------------------------------------------- ----------------- ``__cpp_lib_erase_if`` ``201811L`` ------------------------------------------------- ----------------- ``__cpp_lib_generic_unordered_lookup`` *unimplemented* diff --git a/libcxx/include/version b/libcxx/include/version --- a/libcxx/include/version +++ b/libcxx/include/version @@ -43,6 +43,7 @@ __cpp_lib_constexpr_swap_algorithms 201806L __cpp_lib_destroying_delete 201806L __cpp_lib_enable_shared_from_this 201603L +__cpp_lib_endian 201907L __cpp_lib_erase_if 201811L @@ -223,6 +224,7 @@ # if _LIBCPP_STD_VER > 17 && defined(__cpp_impl_destroying_delete) && __cpp_impl_destroying_delete >= 201806L # define __cpp_lib_destroying_delete 201806L # endif +# define __cpp_lib_endian 201907L # define __cpp_lib_erase_if 201811L // # define __cpp_lib_generic_unordered_lookup 201811L # define __cpp_lib_interpolate 201902L diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/bit.version.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/bit.version.pass.cpp --- a/libcxx/test/std/language.support/support.limits/support.limits.general/bit.version.pass.cpp +++ b/libcxx/test/std/language.support/support.limits/support.limits.general/bit.version.pass.cpp @@ -15,6 +15,7 @@ /* Constant Value __cpp_lib_bit_cast 201806L [C++2a] + __cpp_lib_endian 201907L [C++2a] */ #include @@ -26,18 +27,30 @@ # error "__cpp_lib_bit_cast should not be defined before c++2a" # endif +# ifdef __cpp_lib_endian +# error "__cpp_lib_endian should not be defined before c++2a" +# endif + #elif TEST_STD_VER == 14 # ifdef __cpp_lib_bit_cast # error "__cpp_lib_bit_cast should not be defined before c++2a" # endif +# ifdef __cpp_lib_endian +# error "__cpp_lib_endian should not be defined before c++2a" +# endif + #elif TEST_STD_VER == 17 # ifdef __cpp_lib_bit_cast # error "__cpp_lib_bit_cast should not be defined before c++2a" # endif +# ifdef __cpp_lib_endian +# error "__cpp_lib_endian should not be defined before c++2a" +# endif + #elif TEST_STD_VER > 17 # if !defined(_LIBCPP_VERSION) @@ -53,6 +66,13 @@ # endif # endif +# ifndef __cpp_lib_endian +# error "__cpp_lib_endian should be defined in c++2a" +# endif +# if __cpp_lib_endian != 201907L +# error "__cpp_lib_endian should have the value 201907L in c++2a" +# endif + #endif // TEST_STD_VER > 17 int main(int, char**) { return 0; } diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/version.version.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/version.version.pass.cpp --- a/libcxx/test/std/language.support/support.limits/support.limits.general/version.version.pass.cpp +++ b/libcxx/test/std/language.support/support.limits/support.limits.general/version.version.pass.cpp @@ -37,6 +37,7 @@ __cpp_lib_constexpr_swap_algorithms 201806L [C++2a] __cpp_lib_destroying_delete 201806L [C++2a] __cpp_lib_enable_shared_from_this 201603L [C++17] + __cpp_lib_endian 201907L [C++2a] __cpp_lib_erase_if 201811L [C++2a] __cpp_lib_exchange_function 201304L [C++14] __cpp_lib_execution 201603L [C++17] @@ -197,6 +198,10 @@ # error "__cpp_lib_enable_shared_from_this should not be defined before c++17" # endif +# ifdef __cpp_lib_endian +# error "__cpp_lib_endian should not be defined before c++2a" +# endif + # ifdef __cpp_lib_erase_if # error "__cpp_lib_erase_if should not be defined before c++2a" # endif @@ -537,6 +542,10 @@ # error "__cpp_lib_enable_shared_from_this should not be defined before c++17" # endif +# ifdef __cpp_lib_endian +# error "__cpp_lib_endian should not be defined before c++2a" +# endif + # ifdef __cpp_lib_erase_if # error "__cpp_lib_erase_if should not be defined before c++2a" # endif @@ -994,6 +1003,10 @@ # error "__cpp_lib_enable_shared_from_this should have the value 201603L in c++17" # endif +# ifdef __cpp_lib_endian +# error "__cpp_lib_endian should not be defined before c++2a" +# endif + # ifdef __cpp_lib_erase_if # error "__cpp_lib_erase_if should not be defined before c++2a" # endif @@ -1682,6 +1695,13 @@ # error "__cpp_lib_enable_shared_from_this should have the value 201603L in c++2a" # endif +# ifndef __cpp_lib_endian +# error "__cpp_lib_endian should be defined in c++2a" +# endif +# if __cpp_lib_endian != 201907L +# error "__cpp_lib_endian should have the value 201907L in c++2a" +# endif + # ifndef __cpp_lib_erase_if # error "__cpp_lib_erase_if should be defined in c++2a" # endif diff --git a/libcxx/utils/generate_feature_test_macro_components.py b/libcxx/utils/generate_feature_test_macro_components.py --- a/libcxx/utils/generate_feature_test_macro_components.py +++ b/libcxx/utils/generate_feature_test_macro_components.py @@ -580,6 +580,12 @@ }, "headers": ["numeric"], }, + {"name": "__cpp_lib_endian", + "values": { + "c++2a": int(201907), + }, + "headers": ["bit"], + }, ]], key=lambda tc: tc["name"]) def get_std_dialects(): diff --git a/libcxx/www/cxx2a_status.html b/libcxx/www/cxx2a_status.html --- a/libcxx/www/cxx2a_status.html +++ b/libcxx/www/cxx2a_status.html @@ -181,7 +181,7 @@ P1502LWGStandard library header units for C++20Cologne P1522LWGIterator Difference Type and Integer OverflowCologne P1523LWGViews and Size TypesCologne - P1612LWGRelocate Endian’s SpecificationCologne + P1612LWGRelocate Endian’s SpecificationCologneComplete10.0 P1614LWGThe Mothership has LandedCologne P1638LWGbasic_istream_view::iterator should not be copyableCologne P1643LWGAdd wait/notify to atomic_refCologne