[libc++] Adds __cpp_lib_constexpr_algorithms to utility.
authorMark de Wever <koraq@xs4all.nl>
Tue, 20 Dec 2022 17:02:36 +0000 (18:02 +0100)
committerMark de Wever <koraq@xs4all.nl>
Wed, 21 Dec 2022 16:30:16 +0000 (17:30 +0100)
Implements:
- LWG3792 __cpp_lib_constexpr_algorithms should also be defined in <utility>

Depends on D140407

Reviewed By: #libc, philnik, ldionne

Differential Revision: https://reviews.llvm.org/D140413

libcxx/docs/Status/Cxx2bIssues.csv
libcxx/include/version
libcxx/test/std/language.support/support.limits/support.limits.general/utility.version.compile.pass.cpp
libcxx/utils/generate_feature_test_macro_components.py

index a7dab66..a793c88 100644 (file)
 "`3784 <https://wg21.link/LWG3784>`__","std.compat should not provide ``::byte`` and its friends", "November 2022","","",""
 "`3785 <https://wg21.link/LWG3785>`__","``ranges::to`` is over-constrained on the destination type being a range", "November 2022","","","|ranges|"
 "`3788 <https://wg21.link/LWG3788>`__","``jthread::operator=(jthread&&)`` postconditions are unimplementable under self-assignment", "November 2022","","",""
-"`3792 <https://wg21.link/LWG3792>`__","``__cpp_lib_constexpr_algorithms`` should also be defined in ``<utility>``", "November 2022","","",""
+"`3792 <https://wg21.link/LWG3792>`__","``__cpp_lib_constexpr_algorithms`` should also be defined in ``<utility>``", "November 2022","|Complete|","16.0",""
 "`3795 <https://wg21.link/LWG3795>`__","Self-move-assignment of ``std::future`` and ``std::shared_future`` have unimplementable postconditions", "November 2022","","",""
 "`3796 <https://wg21.link/LWG3796>`__","``movable-box`` as member should use ``default-initialization`` instead of ``copy-initialization``", "November 2022","","","|ranges|"
 "`3798 <https://wg21.link/LWG3798>`__","Rvalue reference and ``iterator_category``", "November 2022","","",""
index 1d10392..ae4e14f 100644 (file)
@@ -55,7 +55,7 @@ __cpp_lib_chrono_udls                                   201304L <chrono>
 __cpp_lib_clamp                                         201603L <algorithm>
 __cpp_lib_complex_udls                                  201309L <complex>
 __cpp_lib_concepts                                      202002L <concepts>
-__cpp_lib_constexpr_algorithms                          201806L <algorithm>
+__cpp_lib_constexpr_algorithms                          201806L <algorithm> <utility>
 __cpp_lib_constexpr_bitset                              202207L <bitset>
 __cpp_lib_constexpr_charconv                            202207L <charconv>
 __cpp_lib_constexpr_cmath                               202202L <cmath> <cstdlib>
index a4f06bc..6a92799 100644 (file)
@@ -17,6 +17,7 @@
 
 /*  Constant                                  Value
     __cpp_lib_as_const                        201510L [C++17]
+    __cpp_lib_constexpr_algorithms            201806L [C++20]
     __cpp_lib_constexpr_utility               201811L [C++20]
     __cpp_lib_exchange_function               201304L [C++14]
     __cpp_lib_forward_like                    202207L [C++2b]
 #   error "__cpp_lib_as_const should not be defined before c++17"
 # endif
 
+# ifdef __cpp_lib_constexpr_algorithms
+#   error "__cpp_lib_constexpr_algorithms should not be defined before c++20"
+# endif
+
 # ifdef __cpp_lib_constexpr_utility
 #   error "__cpp_lib_constexpr_utility should not be defined before c++20"
 # endif
 #   error "__cpp_lib_as_const should not be defined before c++17"
 # endif
 
+# ifdef __cpp_lib_constexpr_algorithms
+#   error "__cpp_lib_constexpr_algorithms should not be defined before c++20"
+# endif
+
 # ifdef __cpp_lib_constexpr_utility
 #   error "__cpp_lib_constexpr_utility should not be defined before c++20"
 # endif
 #   error "__cpp_lib_as_const should have the value 201510L in c++17"
 # endif
 
+# ifdef __cpp_lib_constexpr_algorithms
+#   error "__cpp_lib_constexpr_algorithms should not be defined before c++20"
+# endif
+
 # ifdef __cpp_lib_constexpr_utility
 #   error "__cpp_lib_constexpr_utility should not be defined before c++20"
 # endif
 #   error "__cpp_lib_as_const should have the value 201510L in c++20"
 # endif
 
+# ifndef __cpp_lib_constexpr_algorithms
+#   error "__cpp_lib_constexpr_algorithms should be defined in c++20"
+# endif
+# if __cpp_lib_constexpr_algorithms != 201806L
+#   error "__cpp_lib_constexpr_algorithms should have the value 201806L in c++20"
+# endif
+
 # ifndef __cpp_lib_constexpr_utility
 #   error "__cpp_lib_constexpr_utility should be defined in c++20"
 # endif
 #   error "__cpp_lib_as_const should have the value 201510L in c++2b"
 # endif
 
+# ifndef __cpp_lib_constexpr_algorithms
+#   error "__cpp_lib_constexpr_algorithms should be defined in c++2b"
+# endif
+# if __cpp_lib_constexpr_algorithms != 201806L
+#   error "__cpp_lib_constexpr_algorithms should have the value 201806L in c++2b"
+# endif
+
 # ifndef __cpp_lib_constexpr_utility
 #   error "__cpp_lib_constexpr_utility should be defined in c++2b"
 # endif
index 891981d..ed50218 100755 (executable)
@@ -213,7 +213,7 @@ feature_test_macros = [ add_version_header(x) for x in [
   }, {
     "name": "__cpp_lib_constexpr_algorithms",
     "values": { "c++20": 201806 },
-    "headers": ["algorithm"],
+    "headers": ["algorithm", "utility"],
   }, {
     "name": "__cpp_lib_constexpr_bitset",
     "values": { "c++2b": 202207 },