[libcxx-commits] [libcxx] 2b6ce25 - [libc++] Adds __cpp_lib_constexpr_algorithms to utility.
Mark de Wever via libcxx-commits
libcxx-commits at lists.llvm.org
Wed Dec 21 08:30:20 PST 2022
Author: Mark de Wever
Date: 2022-12-21T17:30:16+01:00
New Revision: 2b6ce25a2a569fe7a61d2eee630620055d47d3bd
URL: https://github.com/llvm/llvm-project/commit/2b6ce25a2a569fe7a61d2eee630620055d47d3bd
DIFF: https://github.com/llvm/llvm-project/commit/2b6ce25a2a569fe7a61d2eee630620055d47d3bd.diff
LOG: [libc++] Adds __cpp_lib_constexpr_algorithms to utility.
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
Added:
Modified:
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
Removed:
################################################################################
diff --git a/libcxx/docs/Status/Cxx2bIssues.csv b/libcxx/docs/Status/Cxx2bIssues.csv
index a7dab66c35cc2..a793c88d03ba9 100644
--- a/libcxx/docs/Status/Cxx2bIssues.csv
+++ b/libcxx/docs/Status/Cxx2bIssues.csv
@@ -231,7 +231,7 @@
"`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","","",""
diff --git a/libcxx/include/version b/libcxx/include/version
index 1d10392964445..ae4e14f337284 100644
--- a/libcxx/include/version
+++ b/libcxx/include/version
@@ -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>
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/utility.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/utility.version.compile.pass.cpp
index a4f06bce07cd6..6a92799b1f026 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/utility.version.compile.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/utility.version.compile.pass.cpp
@@ -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]
@@ -37,6 +38,10 @@
# 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
@@ -79,6 +84,10 @@
# 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
@@ -133,6 +142,10 @@
# 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
@@ -187,6 +200,13 @@
# 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
@@ -247,6 +267,13 @@
# 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
diff --git a/libcxx/utils/generate_feature_test_macro_components.py b/libcxx/utils/generate_feature_test_macro_components.py
index 891981d45b8d6..ed502184a3413 100755
--- a/libcxx/utils/generate_feature_test_macro_components.py
+++ b/libcxx/utils/generate_feature_test_macro_components.py
@@ -213,7 +213,7 @@ def add_version_header(tc):
}, {
"name": "__cpp_lib_constexpr_algorithms",
"values": { "c++20": 201806 },
- "headers": ["algorithm"],
+ "headers": ["algorithm", "utility"],
}, {
"name": "__cpp_lib_constexpr_bitset",
"values": { "c++2b": 202207 },
More information about the libcxx-commits
mailing list