Skip to content

Commit 45d51f9

Browse files
committed
[libc++] U[dated <version>'s __cpp_lib_constrained_equality value
[P3379R0](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3379r0.html) updates `__cpp_lib_constrained_equality` value
1 parent 9e16792 commit 45d51f9

File tree

8 files changed

+51
-15
lines changed

8 files changed

+51
-15
lines changed

libcxx/include/version

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,8 @@ __cpp_lib_constexpr_tuple 201811L <tuple>
8282
__cpp_lib_constexpr_typeinfo 202106L <typeinfo>
8383
__cpp_lib_constexpr_utility 201811L <utility>
8484
__cpp_lib_constexpr_vector 201907L <vector>
85-
__cpp_lib_constrained_equality 202403L <optional> <tuple> <utility>
86-
<variant>
85+
__cpp_lib_constrained_equality 202411L <expected> <optional> <tuple>
86+
<utility> <variant>
8787
__cpp_lib_containers_ranges 202202L <deque> <forward_list> <list>
8888
<map> <queue> <set>
8989
<stack> <string> <unordered_map>
@@ -549,7 +549,7 @@ __cpp_lib_void_t 201411L <type_traits>
549549
# define __cpp_lib_constexpr_new 202406L
550550
# endif
551551
# define __cpp_lib_constexpr_queue 202502L
552-
// # define __cpp_lib_constrained_equality 202403L
552+
// # define __cpp_lib_constrained_equality 202411L
553553
// # define __cpp_lib_copyable_function 202306L
554554
// # define __cpp_lib_debugging 202311L
555555
// # define __cpp_lib_default_template_type_for_algorithm_values 202403L

libcxx/test/std/language.support/support.limits/support.limits.general/expected.version.compile.pass.cpp

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@
2020

2121
#if TEST_STD_VER < 14
2222

23+
# ifdef __cpp_lib_constrained_equality
24+
# error "__cpp_lib_constrained_equality should not be defined before c++26"
25+
# endif
26+
2327
# ifdef __cpp_lib_expected
2428
# error "__cpp_lib_expected should not be defined before c++23"
2529
# endif
@@ -30,6 +34,10 @@
3034

3135
#elif TEST_STD_VER == 14
3236

37+
# ifdef __cpp_lib_constrained_equality
38+
# error "__cpp_lib_constrained_equality should not be defined before c++26"
39+
# endif
40+
3341
# ifdef __cpp_lib_expected
3442
# error "__cpp_lib_expected should not be defined before c++23"
3543
# endif
@@ -40,6 +48,10 @@
4048

4149
#elif TEST_STD_VER == 17
4250

51+
# ifdef __cpp_lib_constrained_equality
52+
# error "__cpp_lib_constrained_equality should not be defined before c++26"
53+
# endif
54+
4355
# ifdef __cpp_lib_expected
4456
# error "__cpp_lib_expected should not be defined before c++23"
4557
# endif
@@ -50,6 +62,10 @@
5062

5163
#elif TEST_STD_VER == 20
5264

65+
# ifdef __cpp_lib_constrained_equality
66+
# error "__cpp_lib_constrained_equality should not be defined before c++26"
67+
# endif
68+
5369
# ifdef __cpp_lib_expected
5470
# error "__cpp_lib_expected should not be defined before c++23"
5571
# endif
@@ -60,6 +76,10 @@
6076

6177
#elif TEST_STD_VER == 23
6278

79+
# ifdef __cpp_lib_constrained_equality
80+
# error "__cpp_lib_constrained_equality should not be defined before c++26"
81+
# endif
82+
6383
# ifndef __cpp_lib_expected
6484
# error "__cpp_lib_expected should be defined in c++23"
6585
# endif
@@ -73,6 +93,19 @@
7393

7494
#elif TEST_STD_VER > 23
7595

96+
# if !defined(_LIBCPP_VERSION)
97+
# ifndef __cpp_lib_constrained_equality
98+
# error "__cpp_lib_constrained_equality should be defined in c++26"
99+
# endif
100+
# if __cpp_lib_constrained_equality != 202411L
101+
# error "__cpp_lib_constrained_equality should have the value 202411L in c++26"
102+
# endif
103+
# else
104+
# ifdef __cpp_lib_constrained_equality
105+
# error "__cpp_lib_constrained_equality should not be defined because it is unimplemented in libc++!"
106+
# endif
107+
# endif
108+
76109
# ifndef __cpp_lib_expected
77110
# error "__cpp_lib_expected should be defined in c++26"
78111
# endif

libcxx/test/std/language.support/support.limits/support.limits.general/optional.version.compile.pass.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,8 @@
123123
# ifndef __cpp_lib_constrained_equality
124124
# error "__cpp_lib_constrained_equality should be defined in c++26"
125125
# endif
126-
# if __cpp_lib_constrained_equality != 202403L
127-
# error "__cpp_lib_constrained_equality should have the value 202403L in c++26"
126+
# if __cpp_lib_constrained_equality != 202411L
127+
# error "__cpp_lib_constrained_equality should have the value 202411L in c++26"
128128
# endif
129129
# else
130130
# ifdef __cpp_lib_constrained_equality

libcxx/test/std/language.support/support.limits/support.limits.general/tuple.version.compile.pass.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -274,8 +274,8 @@
274274
# ifndef __cpp_lib_constrained_equality
275275
# error "__cpp_lib_constrained_equality should be defined in c++26"
276276
# endif
277-
# if __cpp_lib_constrained_equality != 202403L
278-
# error "__cpp_lib_constrained_equality should have the value 202403L in c++26"
277+
# if __cpp_lib_constrained_equality != 202411L
278+
# error "__cpp_lib_constrained_equality should have the value 202411L in c++26"
279279
# endif
280280
# else
281281
# ifdef __cpp_lib_constrained_equality

libcxx/test/std/language.support/support.limits/support.limits.general/utility.version.compile.pass.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -405,8 +405,8 @@
405405
# ifndef __cpp_lib_constrained_equality
406406
# error "__cpp_lib_constrained_equality should be defined in c++26"
407407
# endif
408-
# if __cpp_lib_constrained_equality != 202403L
409-
# error "__cpp_lib_constrained_equality should have the value 202403L in c++26"
408+
# if __cpp_lib_constrained_equality != 202411L
409+
# error "__cpp_lib_constrained_equality should have the value 202411L in c++26"
410410
# endif
411411
# else
412412
# ifdef __cpp_lib_constrained_equality

libcxx/test/std/language.support/support.limits/support.limits.general/variant.version.compile.pass.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,8 @@
103103
# ifndef __cpp_lib_constrained_equality
104104
# error "__cpp_lib_constrained_equality should be defined in c++26"
105105
# endif
106-
# if __cpp_lib_constrained_equality != 202403L
107-
# error "__cpp_lib_constrained_equality should have the value 202403L in c++26"
106+
# if __cpp_lib_constrained_equality != 202411L
107+
# error "__cpp_lib_constrained_equality should have the value 202411L in c++26"
108108
# endif
109109
# else
110110
# ifdef __cpp_lib_constrained_equality

libcxx/test/std/language.support/support.limits/support.limits.general/version.version.compile.pass.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6548,8 +6548,8 @@
65486548
# ifndef __cpp_lib_constrained_equality
65496549
# error "__cpp_lib_constrained_equality should be defined in c++26"
65506550
# endif
6551-
# if __cpp_lib_constrained_equality != 202403L
6552-
# error "__cpp_lib_constrained_equality should have the value 202403L in c++26"
6551+
# if __cpp_lib_constrained_equality != 202411L
6552+
# error "__cpp_lib_constrained_equality should have the value 202411L in c++26"
65536553
# endif
65546554
# else
65556555
# ifdef __cpp_lib_constrained_equality

libcxx/utils/generate_feature_test_macro_components.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -426,8 +426,11 @@ def add_version_header(tc):
426426
},
427427
{
428428
"name": "__cpp_lib_constrained_equality",
429-
"values": {"c++26": 202403}, # P2944R3: Comparisons for reference_wrapper
430-
"headers": ["optional", "tuple", "utility", "variant"],
429+
"values": {
430+
# "c++26": 202403, # P2944R3: Comparisons for reference_wrapper
431+
"c++26": 202411, # P3379R0: Constrain std::expected equality operators
432+
},
433+
"headers": ["expected", "optional", "tuple", "utility", "variant"],
431434
"unimplemented": True,
432435
},
433436
{

0 commit comments

Comments
 (0)