[libc++][test] __cpp_lib_within_lifetime -> __cpp_lib_is_within_lifetime (#91896)

The feature test macro was renamed when
[P2641R4](https://wg21.link/P2641R4) was adopted into the standard:
0facada4ca
https://wg21.link/version.syn#lib:__cpp_lib_is_constant_evaluated
This commit is contained in:
Mital Ashok
2024-05-16 08:45:45 +01:00
committed by GitHub
parent de483ad513
commit 8f711aa324
5 changed files with 82 additions and 80 deletions

View File

@@ -436,6 +436,8 @@ Status
---------------------------------------------------------- -----------------
``__cpp_lib_hazard_pointer`` *unimplemented*
---------------------------------------------------------- -----------------
``__cpp_lib_is_within_lifetime`` *unimplemented*
---------------------------------------------------------- -----------------
``__cpp_lib_linalg`` *unimplemented*
---------------------------------------------------------- -----------------
``__cpp_lib_out_ptr`` *unimplemented*
@@ -465,7 +467,5 @@ Status
``__cpp_lib_to_chars`` *unimplemented*
---------------------------------------------------------- -----------------
``__cpp_lib_tuple_like`` *unimplemented*
---------------------------------------------------------- -----------------
``__cpp_lib_within_lifetime`` *unimplemented*
========================================================== =================

View File

@@ -143,6 +143,7 @@ __cpp_lib_is_null_pointer 201309L <type_traits>
__cpp_lib_is_pointer_interconvertible 201907L <type_traits>
__cpp_lib_is_scoped_enum 202011L <type_traits>
__cpp_lib_is_swappable 201603L <type_traits>
__cpp_lib_is_within_lifetime 202306L <type_traits>
__cpp_lib_jthread 201911L <stop_token> <thread>
__cpp_lib_latch 201907L <latch>
__cpp_lib_launder 201606L <new>
@@ -251,7 +252,6 @@ __cpp_lib_unreachable 202202L <utility>
__cpp_lib_unwrap_ref 201811L <functional>
__cpp_lib_variant 202102L <variant>
__cpp_lib_void_t 201411L <type_traits>
__cpp_lib_within_lifetime 202306L <type_traits>
*/
@@ -520,6 +520,7 @@ __cpp_lib_within_lifetime 202306L <type_traits>
// # define __cpp_lib_function_ref 202306L
// # define __cpp_lib_generate_random 202403L
// # define __cpp_lib_hazard_pointer 202306L
// # define __cpp_lib_is_within_lifetime 202306L
// # define __cpp_lib_linalg 202311L
# undef __cpp_lib_out_ptr
// # define __cpp_lib_out_ptr 202311L
@@ -538,7 +539,6 @@ __cpp_lib_within_lifetime 202306L <type_traits>
// # define __cpp_lib_to_chars 202306L
# undef __cpp_lib_tuple_like
// # define __cpp_lib_tuple_like 202311L
// # define __cpp_lib_within_lifetime 202306L
#endif
// clang-format on

View File

@@ -30,6 +30,7 @@
__cpp_lib_is_pointer_interconvertible 201907L [C++20]
__cpp_lib_is_scoped_enum 202011L [C++23]
__cpp_lib_is_swappable 201603L [C++17]
__cpp_lib_is_within_lifetime 202306L [C++26]
__cpp_lib_logical_traits 201510L [C++17]
__cpp_lib_reference_from_temporary 202202L [C++23]
__cpp_lib_remove_cvref 201711L [C++20]
@@ -38,7 +39,6 @@
__cpp_lib_type_identity 201806L [C++20]
__cpp_lib_type_trait_variable_templates 201510L [C++17]
__cpp_lib_void_t 201411L [C++17]
__cpp_lib_within_lifetime 202306L [C++26]
*/
#include <type_traits>
@@ -102,6 +102,10 @@
# error "__cpp_lib_is_swappable should not be defined before c++17"
# endif
# ifdef __cpp_lib_is_within_lifetime
# error "__cpp_lib_is_within_lifetime should not be defined before c++26"
# endif
# ifdef __cpp_lib_logical_traits
# error "__cpp_lib_logical_traits should not be defined before c++17"
# endif
@@ -134,10 +138,6 @@
# error "__cpp_lib_void_t should not be defined before c++17"
# endif
# ifdef __cpp_lib_within_lifetime
# error "__cpp_lib_within_lifetime should not be defined before c++26"
# endif
#elif TEST_STD_VER == 14
# ifdef __cpp_lib_bool_constant
@@ -205,6 +205,10 @@
# error "__cpp_lib_is_swappable should not be defined before c++17"
# endif
# ifdef __cpp_lib_is_within_lifetime
# error "__cpp_lib_is_within_lifetime should not be defined before c++26"
# endif
# ifdef __cpp_lib_logical_traits
# error "__cpp_lib_logical_traits should not be defined before c++17"
# endif
@@ -243,10 +247,6 @@
# error "__cpp_lib_void_t should not be defined before c++17"
# endif
# ifdef __cpp_lib_within_lifetime
# error "__cpp_lib_within_lifetime should not be defined before c++26"
# endif
#elif TEST_STD_VER == 17
# ifndef __cpp_lib_bool_constant
@@ -329,6 +329,10 @@
# error "__cpp_lib_is_swappable should have the value 201603L in c++17"
# endif
# ifdef __cpp_lib_is_within_lifetime
# error "__cpp_lib_is_within_lifetime should not be defined before c++26"
# endif
# ifndef __cpp_lib_logical_traits
# error "__cpp_lib_logical_traits should be defined in c++17"
# endif
@@ -376,10 +380,6 @@
# error "__cpp_lib_void_t should have the value 201411L in c++17"
# endif
# ifdef __cpp_lib_within_lifetime
# error "__cpp_lib_within_lifetime should not be defined before c++26"
# endif
#elif TEST_STD_VER == 20
# ifndef __cpp_lib_bool_constant
@@ -489,6 +489,10 @@
# error "__cpp_lib_is_swappable should have the value 201603L in c++20"
# endif
# ifdef __cpp_lib_is_within_lifetime
# error "__cpp_lib_is_within_lifetime should not be defined before c++26"
# endif
# ifndef __cpp_lib_logical_traits
# error "__cpp_lib_logical_traits should be defined in c++20"
# endif
@@ -542,10 +546,6 @@
# error "__cpp_lib_void_t should have the value 201411L in c++20"
# endif
# ifdef __cpp_lib_within_lifetime
# error "__cpp_lib_within_lifetime should not be defined before c++26"
# endif
#elif TEST_STD_VER == 23
# ifndef __cpp_lib_bool_constant
@@ -658,6 +658,10 @@
# error "__cpp_lib_is_swappable should have the value 201603L in c++23"
# endif
# ifdef __cpp_lib_is_within_lifetime
# error "__cpp_lib_is_within_lifetime should not be defined before c++26"
# endif
# ifndef __cpp_lib_logical_traits
# error "__cpp_lib_logical_traits should be defined in c++23"
# endif
@@ -720,10 +724,6 @@
# error "__cpp_lib_void_t should have the value 201411L in c++23"
# endif
# ifdef __cpp_lib_within_lifetime
# error "__cpp_lib_within_lifetime should not be defined before c++26"
# endif
#elif TEST_STD_VER > 23
# ifndef __cpp_lib_bool_constant
@@ -836,6 +836,19 @@
# error "__cpp_lib_is_swappable should have the value 201603L in c++26"
# endif
# if !defined(_LIBCPP_VERSION)
# ifndef __cpp_lib_is_within_lifetime
# error "__cpp_lib_is_within_lifetime should be defined in c++26"
# endif
# if __cpp_lib_is_within_lifetime != 202306L
# error "__cpp_lib_is_within_lifetime should have the value 202306L in c++26"
# endif
# else // _LIBCPP_VERSION
# ifdef __cpp_lib_is_within_lifetime
# error "__cpp_lib_is_within_lifetime should not be defined because it is unimplemented in libc++!"
# endif
# endif
# ifndef __cpp_lib_logical_traits
# error "__cpp_lib_logical_traits should be defined in c++26"
# endif
@@ -898,18 +911,5 @@
# error "__cpp_lib_void_t should have the value 201411L in c++26"
# endif
# if !defined(_LIBCPP_VERSION)
# ifndef __cpp_lib_within_lifetime
# error "__cpp_lib_within_lifetime should be defined in c++26"
# endif
# if __cpp_lib_within_lifetime != 202306L
# error "__cpp_lib_within_lifetime should have the value 202306L in c++26"
# endif
# else // _LIBCPP_VERSION
# ifdef __cpp_lib_within_lifetime
# error "__cpp_lib_within_lifetime should not be defined because it is unimplemented in libc++!"
# endif
# endif
#endif // TEST_STD_VER > 23

View File

@@ -130,6 +130,7 @@
__cpp_lib_is_pointer_interconvertible 201907L [C++20]
__cpp_lib_is_scoped_enum 202011L [C++23]
__cpp_lib_is_swappable 201603L [C++17]
__cpp_lib_is_within_lifetime 202306L [C++26]
__cpp_lib_jthread 201911L [C++20]
__cpp_lib_latch 201907L [C++20]
__cpp_lib_launder 201606L [C++17]
@@ -232,7 +233,6 @@
__cpp_lib_unwrap_ref 201811L [C++20]
__cpp_lib_variant 202102L [C++17]
__cpp_lib_void_t 201411L [C++17]
__cpp_lib_within_lifetime 202306L [C++26]
*/
#include <version>
@@ -680,6 +680,10 @@
# error "__cpp_lib_is_swappable should not be defined before c++17"
# endif
# ifdef __cpp_lib_is_within_lifetime
# error "__cpp_lib_is_within_lifetime should not be defined before c++26"
# endif
# ifdef __cpp_lib_jthread
# error "__cpp_lib_jthread should not be defined before c++20"
# endif
@@ -1060,10 +1064,6 @@
# error "__cpp_lib_void_t should not be defined before c++17"
# endif
# ifdef __cpp_lib_within_lifetime
# error "__cpp_lib_within_lifetime should not be defined before c++26"
# endif
#elif TEST_STD_VER == 14
# ifdef __cpp_lib_adaptor_iterator_pair_constructor
@@ -1530,6 +1530,10 @@
# error "__cpp_lib_is_swappable should not be defined before c++17"
# endif
# ifdef __cpp_lib_is_within_lifetime
# error "__cpp_lib_is_within_lifetime should not be defined before c++26"
# endif
# ifdef __cpp_lib_jthread
# error "__cpp_lib_jthread should not be defined before c++20"
# endif
@@ -1958,10 +1962,6 @@
# error "__cpp_lib_void_t should not be defined before c++17"
# endif
# ifdef __cpp_lib_within_lifetime
# error "__cpp_lib_within_lifetime should not be defined before c++26"
# endif
#elif TEST_STD_VER == 17
# ifdef __cpp_lib_adaptor_iterator_pair_constructor
@@ -2518,6 +2518,10 @@
# error "__cpp_lib_is_swappable should have the value 201603L in c++17"
# endif
# ifdef __cpp_lib_is_within_lifetime
# error "__cpp_lib_is_within_lifetime should not be defined before c++26"
# endif
# ifdef __cpp_lib_jthread
# error "__cpp_lib_jthread should not be defined before c++20"
# endif
@@ -3054,10 +3058,6 @@
# error "__cpp_lib_void_t should have the value 201411L in c++17"
# endif
# ifdef __cpp_lib_within_lifetime
# error "__cpp_lib_within_lifetime should not be defined before c++26"
# endif
#elif TEST_STD_VER == 20
# ifdef __cpp_lib_adaptor_iterator_pair_constructor
@@ -3797,6 +3797,10 @@
# error "__cpp_lib_is_swappable should have the value 201603L in c++20"
# endif
# ifdef __cpp_lib_is_within_lifetime
# error "__cpp_lib_is_within_lifetime should not be defined before c++26"
# endif
# if !defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_HAS_NO_EXPERIMENTAL_STOP_TOKEN) && (!defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_SYNC)
# ifndef __cpp_lib_jthread
# error "__cpp_lib_jthread should be defined in c++20"
@@ -4438,10 +4442,6 @@
# error "__cpp_lib_void_t should have the value 201411L in c++20"
# endif
# ifdef __cpp_lib_within_lifetime
# error "__cpp_lib_within_lifetime should not be defined before c++26"
# endif
#elif TEST_STD_VER == 23
# ifndef __cpp_lib_adaptor_iterator_pair_constructor
@@ -5259,6 +5259,10 @@
# error "__cpp_lib_is_swappable should have the value 201603L in c++23"
# endif
# ifdef __cpp_lib_is_within_lifetime
# error "__cpp_lib_is_within_lifetime should not be defined before c++26"
# endif
# if !defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_HAS_NO_EXPERIMENTAL_STOP_TOKEN) && (!defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_SYNC)
# ifndef __cpp_lib_jthread
# error "__cpp_lib_jthread should be defined in c++23"
@@ -6056,10 +6060,6 @@
# error "__cpp_lib_void_t should have the value 201411L in c++23"
# endif
# ifdef __cpp_lib_within_lifetime
# error "__cpp_lib_within_lifetime should not be defined before c++26"
# endif
#elif TEST_STD_VER > 23
# ifndef __cpp_lib_adaptor_iterator_pair_constructor
@@ -7042,6 +7042,19 @@
# error "__cpp_lib_is_swappable should have the value 201603L in c++26"
# endif
# if !defined(_LIBCPP_VERSION)
# ifndef __cpp_lib_is_within_lifetime
# error "__cpp_lib_is_within_lifetime should be defined in c++26"
# endif
# if __cpp_lib_is_within_lifetime != 202306L
# error "__cpp_lib_is_within_lifetime should have the value 202306L in c++26"
# endif
# else // _LIBCPP_VERSION
# ifdef __cpp_lib_is_within_lifetime
# error "__cpp_lib_is_within_lifetime should not be defined because it is unimplemented in libc++!"
# endif
# endif
# if !defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_HAS_NO_EXPERIMENTAL_STOP_TOKEN) && (!defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_SYNC)
# ifndef __cpp_lib_jthread
# error "__cpp_lib_jthread should be defined in c++26"
@@ -7911,18 +7924,5 @@
# error "__cpp_lib_void_t should have the value 201411L in c++26"
# endif
# if !defined(_LIBCPP_VERSION)
# ifndef __cpp_lib_within_lifetime
# error "__cpp_lib_within_lifetime should be defined in c++26"
# endif
# if __cpp_lib_within_lifetime != 202306L
# error "__cpp_lib_within_lifetime should have the value 202306L in c++26"
# endif
# else // _LIBCPP_VERSION
# ifdef __cpp_lib_within_lifetime
# error "__cpp_lib_within_lifetime should not be defined because it is unimplemented in libc++!"
# endif
# endif
#endif // TEST_STD_VER > 23

View File

@@ -767,6 +767,16 @@ feature_test_macros = [
"values": {"c++17": 201603},
"headers": ["type_traits"],
},
{
"name": "__cpp_lib_is_within_lifetime",
# Note this name was changed from "__cpp_lib_within_lifetime" when the paper was adopted
# https://github.com/cplusplus/draft/commit/0facada4cadd97e1ba15bfaea76a804f1dc5c309
"values": {
"c++26": 202306 # P2641R4 Checking if a union alternative is active
},
"headers": ["type_traits"],
"unimplemented": True,
},
{
"name": "__cpp_lib_jthread",
"values": {"c++20": 201911},
@@ -1342,14 +1352,6 @@ feature_test_macros = [
"values": {"c++17": 201411},
"headers": ["type_traits"],
},
{
"name": "__cpp_lib_within_lifetime",
"values": {
"c++26": 202306 # P2641R4 Checking if a union alternative is active
},
"headers": ["type_traits"],
"unimplemented": True,
},
]
]