Skip to content

[libc++] Fix P1206R7 feature test macros #90914

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions libcxx/docs/FeatureTestMacroTable.rst
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,8 @@ Status
---------------------------------------------------------- -----------------
``__cpp_lib_constexpr_typeinfo`` ``202106L``
---------------------------------------------------------- -----------------
``__cpp_lib_containers_ranges`` ``202202L``
---------------------------------------------------------- -----------------
``__cpp_lib_expected`` ``202211L``
---------------------------------------------------------- -----------------
``__cpp_lib_format_path`` *unimplemented*
Expand Down
10 changes: 6 additions & 4 deletions libcxx/include/version
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,10 @@ __cpp_lib_constexpr_utility 201811L <utility>
__cpp_lib_constexpr_vector 201907L <vector>
__cpp_lib_constrained_equality 202403L <optional> <tuple> <utility>
<variant>
__cpp_lib_containers_ranges 202202L <deque> <forward_list> <list>
<map> <queue> <set>
<stack> <string> <unordered_map>
<unordered_set> <vector>
__cpp_lib_copyable_function 202306L <functional>
__cpp_lib_coroutine 201902L <coroutine>
__cpp_lib_debugging 202311L <debugging>
Expand Down Expand Up @@ -184,10 +188,7 @@ __cpp_lib_ranges_join_with 202202L <ranges>
__cpp_lib_ranges_repeat 202207L <ranges>
__cpp_lib_ranges_slide 202202L <ranges>
__cpp_lib_ranges_starts_ends_with 202106L <algorithm>
__cpp_lib_ranges_to_container 202202L <deque> <forward_list> <list>
<map> <queue> <ranges>
<set> <stack> <string>
<unordered_map> <unordered_set> <vector>
__cpp_lib_ranges_to_container 202202L <ranges>
__cpp_lib_ranges_zip 202110L <ranges> <tuple> <utility>
__cpp_lib_ratio 202306L <ratio>
__cpp_lib_raw_memory_algorithms 201606L <memory>
Expand Down Expand Up @@ -456,6 +457,7 @@ __cpp_lib_within_lifetime 202306L <type_traits>
# undef __cpp_lib_constexpr_memory
# define __cpp_lib_constexpr_memory 202202L
# define __cpp_lib_constexpr_typeinfo 202106L
# define __cpp_lib_containers_ranges 202202L
# define __cpp_lib_expected 202211L
// # define __cpp_lib_format_path 202403L
# define __cpp_lib_format_ranges 202207L
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@

/* Constant Value
__cpp_lib_allocator_traits_is_always_equal 201411L [C++17]
__cpp_lib_containers_ranges 202202L [C++23]
__cpp_lib_default_template_type_for_algorithm_values 202403L [C++26]
__cpp_lib_erase_if 202002L [C++20]
__cpp_lib_nonmember_container_access 201411L [C++17]
__cpp_lib_ranges_to_container 202202L [C++23]
*/

#include <deque>
Expand All @@ -32,6 +32,10 @@
# error "__cpp_lib_allocator_traits_is_always_equal should not be defined before c++17"
# endif

# ifdef __cpp_lib_containers_ranges
# error "__cpp_lib_containers_ranges should not be defined before c++23"
# endif

# ifdef __cpp_lib_default_template_type_for_algorithm_values
# error "__cpp_lib_default_template_type_for_algorithm_values should not be defined before c++26"
# endif
Expand All @@ -44,16 +48,16 @@
# error "__cpp_lib_nonmember_container_access should not be defined before c++17"
# endif

# ifdef __cpp_lib_ranges_to_container
# error "__cpp_lib_ranges_to_container should not be defined before c++23"
# endif

#elif TEST_STD_VER == 14

# ifdef __cpp_lib_allocator_traits_is_always_equal
# error "__cpp_lib_allocator_traits_is_always_equal should not be defined before c++17"
# endif

# ifdef __cpp_lib_containers_ranges
# error "__cpp_lib_containers_ranges should not be defined before c++23"
# endif

# ifdef __cpp_lib_default_template_type_for_algorithm_values
# error "__cpp_lib_default_template_type_for_algorithm_values should not be defined before c++26"
# endif
Expand All @@ -66,10 +70,6 @@
# error "__cpp_lib_nonmember_container_access should not be defined before c++17"
# endif

# ifdef __cpp_lib_ranges_to_container
# error "__cpp_lib_ranges_to_container should not be defined before c++23"
# endif

#elif TEST_STD_VER == 17

# ifndef __cpp_lib_allocator_traits_is_always_equal
Expand All @@ -79,6 +79,10 @@
# error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++17"
# endif

# ifdef __cpp_lib_containers_ranges
# error "__cpp_lib_containers_ranges should not be defined before c++23"
# endif

# ifdef __cpp_lib_default_template_type_for_algorithm_values
# error "__cpp_lib_default_template_type_for_algorithm_values should not be defined before c++26"
# endif
Expand All @@ -94,10 +98,6 @@
# error "__cpp_lib_nonmember_container_access should have the value 201411L in c++17"
# endif

# ifdef __cpp_lib_ranges_to_container
# error "__cpp_lib_ranges_to_container should not be defined before c++23"
# endif

#elif TEST_STD_VER == 20

# ifndef __cpp_lib_allocator_traits_is_always_equal
Expand All @@ -107,6 +107,10 @@
# error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++20"
# endif

# ifdef __cpp_lib_containers_ranges
# error "__cpp_lib_containers_ranges should not be defined before c++23"
# endif

# ifdef __cpp_lib_default_template_type_for_algorithm_values
# error "__cpp_lib_default_template_type_for_algorithm_values should not be defined before c++26"
# endif
Expand All @@ -125,10 +129,6 @@
# error "__cpp_lib_nonmember_container_access should have the value 201411L in c++20"
# endif

# ifdef __cpp_lib_ranges_to_container
# error "__cpp_lib_ranges_to_container should not be defined before c++23"
# endif

#elif TEST_STD_VER == 23

# ifndef __cpp_lib_allocator_traits_is_always_equal
Expand All @@ -138,6 +138,13 @@
# error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++23"
# endif

# ifndef __cpp_lib_containers_ranges
# error "__cpp_lib_containers_ranges should be defined in c++23"
# endif
# if __cpp_lib_containers_ranges != 202202L
# error "__cpp_lib_containers_ranges should have the value 202202L in c++23"
# endif

# ifdef __cpp_lib_default_template_type_for_algorithm_values
# error "__cpp_lib_default_template_type_for_algorithm_values should not be defined before c++26"
# endif
Expand All @@ -156,13 +163,6 @@
# error "__cpp_lib_nonmember_container_access should have the value 201411L in c++23"
# endif

# ifndef __cpp_lib_ranges_to_container
# error "__cpp_lib_ranges_to_container should be defined in c++23"
# endif
# if __cpp_lib_ranges_to_container != 202202L
# error "__cpp_lib_ranges_to_container should have the value 202202L in c++23"
# endif

#elif TEST_STD_VER > 23

# ifndef __cpp_lib_allocator_traits_is_always_equal
Expand All @@ -172,6 +172,13 @@
# error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++26"
# endif

# ifndef __cpp_lib_containers_ranges
# error "__cpp_lib_containers_ranges should be defined in c++26"
# endif
# if __cpp_lib_containers_ranges != 202202L
# error "__cpp_lib_containers_ranges should have the value 202202L in c++26"
# endif

# if !defined(_LIBCPP_VERSION)
# ifndef __cpp_lib_default_template_type_for_algorithm_values
# error "__cpp_lib_default_template_type_for_algorithm_values should be defined in c++26"
Expand Down Expand Up @@ -199,12 +206,5 @@
# error "__cpp_lib_nonmember_container_access should have the value 201411L in c++26"
# endif

# ifndef __cpp_lib_ranges_to_container
# error "__cpp_lib_ranges_to_container should be defined in c++26"
# endif
# if __cpp_lib_ranges_to_container != 202202L
# error "__cpp_lib_ranges_to_container should have the value 202202L in c++26"
# endif

#endif // TEST_STD_VER > 23

Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@

/* Constant Value
__cpp_lib_allocator_traits_is_always_equal 201411L [C++17]
__cpp_lib_containers_ranges 202202L [C++23]
__cpp_lib_default_template_type_for_algorithm_values 202403L [C++26]
__cpp_lib_erase_if 202002L [C++20]
__cpp_lib_incomplete_container_elements 201505L [C++17]
__cpp_lib_list_remove_return_type 201806L [C++20]
__cpp_lib_nonmember_container_access 201411L [C++17]
__cpp_lib_ranges_to_container 202202L [C++23]
*/

#include <forward_list>
Expand All @@ -34,6 +34,10 @@
# error "__cpp_lib_allocator_traits_is_always_equal should not be defined before c++17"
# endif

# ifdef __cpp_lib_containers_ranges
# error "__cpp_lib_containers_ranges should not be defined before c++23"
# endif

# ifdef __cpp_lib_default_template_type_for_algorithm_values
# error "__cpp_lib_default_template_type_for_algorithm_values should not be defined before c++26"
# endif
Expand All @@ -54,16 +58,16 @@
# error "__cpp_lib_nonmember_container_access should not be defined before c++17"
# endif

# ifdef __cpp_lib_ranges_to_container
# error "__cpp_lib_ranges_to_container should not be defined before c++23"
# endif

#elif TEST_STD_VER == 14

# ifdef __cpp_lib_allocator_traits_is_always_equal
# error "__cpp_lib_allocator_traits_is_always_equal should not be defined before c++17"
# endif

# ifdef __cpp_lib_containers_ranges
# error "__cpp_lib_containers_ranges should not be defined before c++23"
# endif

# ifdef __cpp_lib_default_template_type_for_algorithm_values
# error "__cpp_lib_default_template_type_for_algorithm_values should not be defined before c++26"
# endif
Expand All @@ -84,10 +88,6 @@
# error "__cpp_lib_nonmember_container_access should not be defined before c++17"
# endif

# ifdef __cpp_lib_ranges_to_container
# error "__cpp_lib_ranges_to_container should not be defined before c++23"
# endif

#elif TEST_STD_VER == 17

# ifndef __cpp_lib_allocator_traits_is_always_equal
Expand All @@ -97,6 +97,10 @@
# error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++17"
# endif

# ifdef __cpp_lib_containers_ranges
# error "__cpp_lib_containers_ranges should not be defined before c++23"
# endif

# ifdef __cpp_lib_default_template_type_for_algorithm_values
# error "__cpp_lib_default_template_type_for_algorithm_values should not be defined before c++26"
# endif
Expand All @@ -123,10 +127,6 @@
# error "__cpp_lib_nonmember_container_access should have the value 201411L in c++17"
# endif

# ifdef __cpp_lib_ranges_to_container
# error "__cpp_lib_ranges_to_container should not be defined before c++23"
# endif

#elif TEST_STD_VER == 20

# ifndef __cpp_lib_allocator_traits_is_always_equal
Expand All @@ -136,6 +136,10 @@
# error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++20"
# endif

# ifdef __cpp_lib_containers_ranges
# error "__cpp_lib_containers_ranges should not be defined before c++23"
# endif

# ifdef __cpp_lib_default_template_type_for_algorithm_values
# error "__cpp_lib_default_template_type_for_algorithm_values should not be defined before c++26"
# endif
Expand Down Expand Up @@ -168,10 +172,6 @@
# error "__cpp_lib_nonmember_container_access should have the value 201411L in c++20"
# endif

# ifdef __cpp_lib_ranges_to_container
# error "__cpp_lib_ranges_to_container should not be defined before c++23"
# endif

#elif TEST_STD_VER == 23

# ifndef __cpp_lib_allocator_traits_is_always_equal
Expand All @@ -181,6 +181,13 @@
# error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++23"
# endif

# ifndef __cpp_lib_containers_ranges
# error "__cpp_lib_containers_ranges should be defined in c++23"
# endif
# if __cpp_lib_containers_ranges != 202202L
# error "__cpp_lib_containers_ranges should have the value 202202L in c++23"
# endif

# ifdef __cpp_lib_default_template_type_for_algorithm_values
# error "__cpp_lib_default_template_type_for_algorithm_values should not be defined before c++26"
# endif
Expand Down Expand Up @@ -213,13 +220,6 @@
# error "__cpp_lib_nonmember_container_access should have the value 201411L in c++23"
# endif

# ifndef __cpp_lib_ranges_to_container
# error "__cpp_lib_ranges_to_container should be defined in c++23"
# endif
# if __cpp_lib_ranges_to_container != 202202L
# error "__cpp_lib_ranges_to_container should have the value 202202L in c++23"
# endif

#elif TEST_STD_VER > 23

# ifndef __cpp_lib_allocator_traits_is_always_equal
Expand All @@ -229,6 +229,13 @@
# error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++26"
# endif

# ifndef __cpp_lib_containers_ranges
# error "__cpp_lib_containers_ranges should be defined in c++26"
# endif
# if __cpp_lib_containers_ranges != 202202L
# error "__cpp_lib_containers_ranges should have the value 202202L in c++26"
# endif

# if !defined(_LIBCPP_VERSION)
# ifndef __cpp_lib_default_template_type_for_algorithm_values
# error "__cpp_lib_default_template_type_for_algorithm_values should be defined in c++26"
Expand Down Expand Up @@ -270,12 +277,5 @@
# error "__cpp_lib_nonmember_container_access should have the value 201411L in c++26"
# endif

# ifndef __cpp_lib_ranges_to_container
# error "__cpp_lib_ranges_to_container should be defined in c++26"
# endif
# if __cpp_lib_ranges_to_container != 202202L
# error "__cpp_lib_ranges_to_container should have the value 202202L in c++26"
# endif

#endif // TEST_STD_VER > 23

Loading