Skip to content

Commit 945ce1a

Browse files
authored
[libc++] Update the value of __cpp_lib_constrained_equality after P3379R0 (llvm#144553)
https://wg21.link/P3379R0 updated the value of __cpp_lib_constrained_equality, but we forgot to update it when we implemented the paper.
1 parent edbaf19 commit 945ce1a

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
@@ -83,8 +83,8 @@ __cpp_lib_constexpr_tuple 201811L <tuple>
8383
__cpp_lib_constexpr_typeinfo 202106L <typeinfo>
8484
__cpp_lib_constexpr_utility 201811L <utility>
8585
__cpp_lib_constexpr_vector 201907L <vector>
86-
__cpp_lib_constrained_equality 202403L <optional> <tuple> <utility>
87-
<variant>
86+
__cpp_lib_constrained_equality 202411L <expected> <optional> <tuple>
87+
<utility> <variant>
8888
__cpp_lib_containers_ranges 202202L <deque> <forward_list> <list>
8989
<map> <queue> <set>
9090
<stack> <string> <unordered_map>
@@ -551,7 +551,7 @@ __cpp_lib_void_t 201411L <type_traits>
551551
# define __cpp_lib_constexpr_new 202406L
552552
# endif
553553
# define __cpp_lib_constexpr_queue 202502L
554-
// # define __cpp_lib_constrained_equality 202403L
554+
// # define __cpp_lib_constrained_equality 202411L
555555
// # define __cpp_lib_copyable_function 202306L
556556
// # define __cpp_lib_debugging 202311L
557557
// # 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
@@ -6575,8 +6575,8 @@
65756575
# ifndef __cpp_lib_constrained_equality
65766576
# error "__cpp_lib_constrained_equality should be defined in c++26"
65776577
# endif
6578-
# if __cpp_lib_constrained_equality != 202403L
6579-
# error "__cpp_lib_constrained_equality should have the value 202403L in c++26"
6578+
# if __cpp_lib_constrained_equality != 202411L
6579+
# error "__cpp_lib_constrained_equality should have the value 202411L in c++26"
65806580
# endif
65816581
# else
65826582
# 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
@@ -431,8 +431,11 @@ def add_version_header(tc):
431431
},
432432
{
433433
"name": "__cpp_lib_constrained_equality",
434-
"values": {"c++26": 202403}, # P2944R3: Comparisons for reference_wrapper
435-
"headers": ["optional", "tuple", "utility", "variant"],
434+
"values": {
435+
# "c++26": 202403, # P2944R3: Comparisons for reference_wrapper
436+
"c++26": 202411, # P3379R0: Constrain std::expected equality operators
437+
},
438+
"headers": ["expected", "optional", "tuple", "utility", "variant"],
436439
"unimplemented": True,
437440
},
438441
{

0 commit comments

Comments
 (0)