From: Mark de Wever Date: Tue, 20 Dec 2022 17:02:36 +0000 (+0100) Subject: [libc++] Adds __cpp_lib_constexpr_algorithms to utility. X-Git-Tag: upstream/17.0.6~22950 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2b6ce25a2a569fe7a61d2eee630620055d47d3bd;p=platform%2Fupstream%2Fllvm.git [libc++] Adds __cpp_lib_constexpr_algorithms to utility. Implements: - LWG3792 __cpp_lib_constexpr_algorithms should also be defined in Depends on D140407 Reviewed By: #libc, philnik, ldionne Differential Revision: https://reviews.llvm.org/D140413 --- diff --git a/libcxx/docs/Status/Cxx2bIssues.csv b/libcxx/docs/Status/Cxx2bIssues.csv index a7dab66..a793c88 100644 --- a/libcxx/docs/Status/Cxx2bIssues.csv +++ b/libcxx/docs/Status/Cxx2bIssues.csv @@ -231,7 +231,7 @@ "`3784 `__","std.compat should not provide ``::byte`` and its friends", "November 2022","","","" "`3785 `__","``ranges::to`` is over-constrained on the destination type being a range", "November 2022","","","|ranges|" "`3788 `__","``jthread::operator=(jthread&&)`` postconditions are unimplementable under self-assignment", "November 2022","","","" -"`3792 `__","``__cpp_lib_constexpr_algorithms`` should also be defined in ````", "November 2022","","","" +"`3792 `__","``__cpp_lib_constexpr_algorithms`` should also be defined in ````", "November 2022","|Complete|","16.0","" "`3795 `__","Self-move-assignment of ``std::future`` and ``std::shared_future`` have unimplementable postconditions", "November 2022","","","" "`3796 `__","``movable-box`` as member should use ``default-initialization`` instead of ``copy-initialization``", "November 2022","","","|ranges|" "`3798 `__","Rvalue reference and ``iterator_category``", "November 2022","","","" diff --git a/libcxx/include/version b/libcxx/include/version index 1d10392..ae4e14f 100644 --- a/libcxx/include/version +++ b/libcxx/include/version @@ -55,7 +55,7 @@ __cpp_lib_chrono_udls 201304L __cpp_lib_clamp 201603L __cpp_lib_complex_udls 201309L __cpp_lib_concepts 202002L -__cpp_lib_constexpr_algorithms 201806L +__cpp_lib_constexpr_algorithms 201806L __cpp_lib_constexpr_bitset 202207L __cpp_lib_constexpr_charconv 202207L __cpp_lib_constexpr_cmath 202202L 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 a4f06bc..6a92799 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 891981d..ed50218 100755 --- a/libcxx/utils/generate_feature_test_macro_components.py +++ b/libcxx/utils/generate_feature_test_macro_components.py @@ -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 },