[libc++] Bump `__cpp_lib_constexpr_algorithms` for P2562R1 in C++26 (#132075) Completes P2562R1. GitOrigin-RevId: 6038077dde965926d621860382e00e147cb7fbe8
diff --git a/docs/FeatureTestMacroTable.rst b/docs/FeatureTestMacroTable.rst index dcf9838..bbcc76b 100644 --- a/docs/FeatureTestMacroTable.rst +++ b/docs/FeatureTestMacroTable.rst
@@ -416,6 +416,8 @@ ---------------------------------------------------------- ----------------- ``__cpp_lib_bitset`` ``202306L`` ---------------------------------------------------------- ----------------- + ``__cpp_lib_constexpr_algorithms`` ``202306L`` + ---------------------------------------------------------- ----------------- ``__cpp_lib_constexpr_new`` ``202406L`` ---------------------------------------------------------- ----------------- ``__cpp_lib_constrained_equality`` *unimplemented*
diff --git a/docs/ReleaseNotes/21.rst b/docs/ReleaseNotes/21.rst index f41cf9b..5bb25af 100644 --- a/docs/ReleaseNotes/21.rst +++ b/docs/ReleaseNotes/21.rst
@@ -42,6 +42,7 @@ - P0767R1: Deprecate POD (`Github <https://github.com/llvm/llvm-project/issues/104013>`__) - P1361R2: Integration of chrono with text formatting (`Github <https://github.com/llvm/llvm-project/issues/100014>`__) - P2255R2: A type trait to detect reference binding to temporary (implemented the type traits only) (`Github <https://github.com/llvm/llvm-project/issues/105180>`__) +- P2562R1: ``constexpr`` Stable Sorting (`Github <https://github.com/llvm/llvm-project/issues/105360>`__) Improvements and New Features -----------------------------
diff --git a/docs/Status/Cxx2cPapers.csv b/docs/Status/Cxx2cPapers.csv index 1436db6..9a4cd3e 100644 --- a/docs/Status/Cxx2cPapers.csv +++ b/docs/Status/Cxx2cPapers.csv
@@ -2,7 +2,7 @@ "`P2497R0 <https://wg21.link/P2497R0>`__","Testing for success or failure of ``<charconv>`` functions","2023-06 (Varna)","|Complete|","18","" "`P2592R3 <https://wg21.link/P2592R3>`__","Hashing support for ``std::chrono`` value classes","2023-06 (Varna)","","","" "`P2587R3 <https://wg21.link/P2587R3>`__","``to_string`` or not ``to_string``","2023-06 (Varna)","","","" -"`P2562R1 <https://wg21.link/P2562R1>`__","``constexpr`` Stable Sorting","2023-06 (Varna)","|Partial|","20","" +"`P2562R1 <https://wg21.link/P2562R1>`__","``constexpr`` Stable Sorting","2023-06 (Varna)","|Complete|","21","" "`P2545R4 <https://wg21.link/P2545R4>`__","Read-Copy Update (RCU)","2023-06 (Varna)","","","" "`P2530R3 <https://wg21.link/P2530R3>`__","Hazard Pointers for C++26","2023-06 (Varna)","","","" "`P2538R1 <https://wg21.link/P2538R1>`__","ADL-proof ``std::projected``","2023-06 (Varna)","|Complete|","18",""
diff --git a/include/version b/include/version index 63ead9f..83ae11d 100644 --- a/include/version +++ b/include/version
@@ -60,7 +60,8 @@ __cpp_lib_clamp 201603L <algorithm> __cpp_lib_complex_udls 201309L <complex> __cpp_lib_concepts 202002L <concepts> -__cpp_lib_constexpr_algorithms 201806L <algorithm> <utility> +__cpp_lib_constexpr_algorithms 202306L <algorithm> <utility> + 201806L // C++20 __cpp_lib_constexpr_bitset 202207L <bitset> __cpp_lib_constexpr_charconv 202207L <charconv> __cpp_lib_constexpr_cmath 202202L <cmath> <cstdlib> @@ -536,6 +537,8 @@ # undef __cpp_lib_bind_front # define __cpp_lib_bind_front 202306L # define __cpp_lib_bitset 202306L +# undef __cpp_lib_constexpr_algorithms +# define __cpp_lib_constexpr_algorithms 202306L # if !defined(_LIBCPP_ABI_VCRUNTIME) # define __cpp_lib_constexpr_new 202406L # endif
diff --git a/test/std/language.support/support.limits/support.limits.general/algorithm.version.compile.pass.cpp b/test/std/language.support/support.limits/support.limits.general/algorithm.version.compile.pass.cpp index 42ccbfc..acc13e5 100644 --- a/test/std/language.support/support.limits/support.limits.general/algorithm.version.compile.pass.cpp +++ b/test/std/language.support/support.limits/support.limits.general/algorithm.version.compile.pass.cpp
@@ -18,6 +18,7 @@ /* Constant Value __cpp_lib_clamp 201603L [C++17] __cpp_lib_constexpr_algorithms 201806L [C++20] + 202306L [C++26] __cpp_lib_default_template_type_for_algorithm_values 202403L [C++26] __cpp_lib_freestanding_algorithm 202311L [C++26] __cpp_lib_parallel_algorithm 201603L [C++17] @@ -380,8 +381,8 @@ # ifndef __cpp_lib_constexpr_algorithms # error "__cpp_lib_constexpr_algorithms should be defined in c++26" # endif -# if __cpp_lib_constexpr_algorithms != 201806L -# error "__cpp_lib_constexpr_algorithms should have the value 201806L in c++26" +# if __cpp_lib_constexpr_algorithms != 202306L +# error "__cpp_lib_constexpr_algorithms should have the value 202306L in c++26" # endif # if !defined(_LIBCPP_VERSION)
diff --git a/test/std/language.support/support.limits/support.limits.general/utility.version.compile.pass.cpp b/test/std/language.support/support.limits/support.limits.general/utility.version.compile.pass.cpp index ab0988f..2a750ad 100644 --- a/test/std/language.support/support.limits/support.limits.general/utility.version.compile.pass.cpp +++ b/test/std/language.support/support.limits/support.limits.general/utility.version.compile.pass.cpp
@@ -18,6 +18,7 @@ /* Constant Value __cpp_lib_as_const 201510L [C++17] __cpp_lib_constexpr_algorithms 201806L [C++20] + 202306L [C++26] __cpp_lib_constexpr_utility 201811L [C++20] __cpp_lib_constrained_equality 202403L [C++26] __cpp_lib_exchange_function 201304L [C++14] @@ -407,8 +408,8 @@ # ifndef __cpp_lib_constexpr_algorithms # error "__cpp_lib_constexpr_algorithms should be defined in c++26" # endif -# if __cpp_lib_constexpr_algorithms != 201806L -# error "__cpp_lib_constexpr_algorithms should have the value 201806L in c++26" +# if __cpp_lib_constexpr_algorithms != 202306L +# error "__cpp_lib_constexpr_algorithms should have the value 202306L in c++26" # endif # ifndef __cpp_lib_constexpr_utility
diff --git a/test/std/language.support/support.limits/support.limits.general/version.version.compile.pass.cpp b/test/std/language.support/support.limits/support.limits.general/version.version.compile.pass.cpp index 1e4465d..59e32ca 100644 --- a/test/std/language.support/support.limits/support.limits.general/version.version.compile.pass.cpp +++ b/test/std/language.support/support.limits/support.limits.general/version.version.compile.pass.cpp
@@ -56,6 +56,7 @@ __cpp_lib_complex_udls 201309L [C++14] __cpp_lib_concepts 202002L [C++20] __cpp_lib_constexpr_algorithms 201806L [C++20] + 202306L [C++26] __cpp_lib_constexpr_bitset 202207L [C++23] __cpp_lib_constexpr_charconv 202207L [C++23] __cpp_lib_constexpr_cmath 202202L [C++23] @@ -6565,8 +6566,8 @@ # ifndef __cpp_lib_constexpr_algorithms # error "__cpp_lib_constexpr_algorithms should be defined in c++26" # endif -# if __cpp_lib_constexpr_algorithms != 201806L -# error "__cpp_lib_constexpr_algorithms should have the value 201806L in c++26" +# if __cpp_lib_constexpr_algorithms != 202306L +# error "__cpp_lib_constexpr_algorithms should have the value 202306L in c++26" # endif # ifndef __cpp_lib_constexpr_bitset
diff --git a/utils/generate_feature_test_macro_components.py b/utils/generate_feature_test_macro_components.py index 8bf7633..9f1bfe1 100755 --- a/utils/generate_feature_test_macro_components.py +++ b/utils/generate_feature_test_macro_components.py
@@ -320,7 +320,7 @@ "name": "__cpp_lib_constexpr_algorithms", "values": { "c++20": 201806, - # "c++26": 202306, # P2562R1 constexpr Stable Sorting + "c++26": 202306, }, "headers": ["algorithm", "utility"], },