Skip to content

Commit cf3f4a8

Browse files
[libc++] Set feature-test macro __cpp_lib_constrained_equality
And add a release note for P2944R3 and P3379R0.
1 parent 0d4c779 commit cf3f4a8

File tree

10 files changed

+34
-70
lines changed

10 files changed

+34
-70
lines changed

libcxx/docs/FeatureTestMacroTable.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,7 @@ Status
432432
---------------------------------------------------------- -----------------
433433
``__cpp_lib_constexpr_queue`` ``202502L``
434434
---------------------------------------------------------- -----------------
435-
``__cpp_lib_constrained_equality`` *unimplemented*
435+
``__cpp_lib_constrained_equality`` ``202411L``
436436
---------------------------------------------------------- -----------------
437437
``__cpp_lib_copyable_function`` *unimplemented*
438438
---------------------------------------------------------- -----------------

libcxx/docs/ReleaseNotes/21.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ Implemented Papers
5353
- P2711R1: Making multi-param constructors of ``views`` ``explicit`` (`Github <https://github.com/llvm/llvm-project/issues/105252>`__)
5454
- P2770R0: Stashing stashing ``iterators`` for proper flattening (`Github <https://github.com/llvm/llvm-project/issues/105250>`__)
5555
- P2655R3: ``common_reference_t`` of ``reference_wrapper`` Should Be a Reference Type (`Github <https://github.com/llvm/llvm-project/issues/105260>`__)
56+
- P2944R3: Comparisons for ``reference_wrapper`` (`Github <https://github.com/llvm/llvm-project/issues/105424>`__)
57+
- P3379R0: Constrain ``std::expected equality`` operators (`Github <https://github.com/llvm/llvm-project/issues/118135>`__)
5658

5759
Improvements and New Features
5860
-----------------------------

libcxx/include/version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -555,7 +555,7 @@ __cpp_lib_void_t 201411L <type_traits>
555555
# define __cpp_lib_constexpr_new 202406L
556556
# endif
557557
# define __cpp_lib_constexpr_queue 202502L
558-
// # define __cpp_lib_constrained_equality 202411L
558+
# define __cpp_lib_constrained_equality 202411L
559559
// # define __cpp_lib_copyable_function 202306L
560560
// # define __cpp_lib_debugging 202311L
561561
// # 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: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -93,17 +93,11 @@
9393

9494
#elif TEST_STD_VER > 23
9595

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
96+
# ifndef __cpp_lib_constrained_equality
97+
# error "__cpp_lib_constrained_equality should be defined in c++26"
98+
# endif
99+
# if __cpp_lib_constrained_equality != 202411L
100+
# error "__cpp_lib_constrained_equality should have the value 202411L in c++26"
107101
# endif
108102

109103
# ifndef __cpp_lib_expected

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

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -119,17 +119,11 @@
119119

120120
#elif TEST_STD_VER > 23
121121

122-
# if !defined(_LIBCPP_VERSION)
123-
# ifndef __cpp_lib_constrained_equality
124-
# error "__cpp_lib_constrained_equality should be defined in c++26"
125-
# endif
126-
# if __cpp_lib_constrained_equality != 202411L
127-
# error "__cpp_lib_constrained_equality should have the value 202411L in c++26"
128-
# endif
129-
# else
130-
# ifdef __cpp_lib_constrained_equality
131-
# error "__cpp_lib_constrained_equality should not be defined because it is unimplemented in libc++!"
132-
# endif
122+
# ifndef __cpp_lib_constrained_equality
123+
# error "__cpp_lib_constrained_equality should be defined in c++26"
124+
# endif
125+
# if __cpp_lib_constrained_equality != 202411L
126+
# error "__cpp_lib_constrained_equality should have the value 202411L in c++26"
133127
# endif
134128

135129
# if !defined(_LIBCPP_VERSION)

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

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -270,17 +270,11 @@
270270
# error "__cpp_lib_constexpr_tuple should have the value 201811L in c++26"
271271
# endif
272272

273-
# if !defined(_LIBCPP_VERSION)
274-
# ifndef __cpp_lib_constrained_equality
275-
# error "__cpp_lib_constrained_equality should be defined in c++26"
276-
# endif
277-
# if __cpp_lib_constrained_equality != 202411L
278-
# error "__cpp_lib_constrained_equality should have the value 202411L in c++26"
279-
# endif
280-
# else
281-
# ifdef __cpp_lib_constrained_equality
282-
# error "__cpp_lib_constrained_equality should not be defined because it is unimplemented in libc++!"
283-
# endif
273+
# ifndef __cpp_lib_constrained_equality
274+
# error "__cpp_lib_constrained_equality should be defined in c++26"
275+
# endif
276+
# if __cpp_lib_constrained_equality != 202411L
277+
# error "__cpp_lib_constrained_equality should have the value 202411L in c++26"
284278
# endif
285279

286280
# ifndef __cpp_lib_make_from_tuple

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

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -401,17 +401,11 @@
401401
# error "__cpp_lib_constexpr_utility should have the value 201811L in c++26"
402402
# endif
403403

404-
# if !defined(_LIBCPP_VERSION)
405-
# ifndef __cpp_lib_constrained_equality
406-
# error "__cpp_lib_constrained_equality should be defined in c++26"
407-
# endif
408-
# if __cpp_lib_constrained_equality != 202411L
409-
# error "__cpp_lib_constrained_equality should have the value 202411L in c++26"
410-
# endif
411-
# else
412-
# ifdef __cpp_lib_constrained_equality
413-
# error "__cpp_lib_constrained_equality should not be defined because it is unimplemented in libc++!"
414-
# endif
404+
# ifndef __cpp_lib_constrained_equality
405+
# error "__cpp_lib_constrained_equality should be defined in c++26"
406+
# endif
407+
# if __cpp_lib_constrained_equality != 202411L
408+
# error "__cpp_lib_constrained_equality should have the value 202411L in c++26"
415409
# endif
416410

417411
# ifndef __cpp_lib_exchange_function

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

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -99,17 +99,11 @@
9999

100100
#elif TEST_STD_VER > 23
101101

102-
# if !defined(_LIBCPP_VERSION)
103-
# ifndef __cpp_lib_constrained_equality
104-
# error "__cpp_lib_constrained_equality should be defined in c++26"
105-
# endif
106-
# if __cpp_lib_constrained_equality != 202411L
107-
# error "__cpp_lib_constrained_equality should have the value 202411L in c++26"
108-
# endif
109-
# else
110-
# ifdef __cpp_lib_constrained_equality
111-
# error "__cpp_lib_constrained_equality should not be defined because it is unimplemented in libc++!"
112-
# endif
102+
# ifndef __cpp_lib_constrained_equality
103+
# error "__cpp_lib_constrained_equality should be defined in c++26"
104+
# endif
105+
# if __cpp_lib_constrained_equality != 202411L
106+
# error "__cpp_lib_constrained_equality should have the value 202411L in c++26"
113107
# endif
114108

115109
# if !defined(_LIBCPP_VERSION)

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

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6631,17 +6631,11 @@
66316631
# error "__cpp_lib_constexpr_vector should have the value 201907L in c++26"
66326632
# endif
66336633

6634-
# if !defined(_LIBCPP_VERSION)
6635-
# ifndef __cpp_lib_constrained_equality
6636-
# error "__cpp_lib_constrained_equality should be defined in c++26"
6637-
# endif
6638-
# if __cpp_lib_constrained_equality != 202411L
6639-
# error "__cpp_lib_constrained_equality should have the value 202411L in c++26"
6640-
# endif
6641-
# else
6642-
# ifdef __cpp_lib_constrained_equality
6643-
# error "__cpp_lib_constrained_equality should not be defined because it is unimplemented in libc++!"
6644-
# endif
6634+
# ifndef __cpp_lib_constrained_equality
6635+
# error "__cpp_lib_constrained_equality should be defined in c++26"
6636+
# endif
6637+
# if __cpp_lib_constrained_equality != 202411L
6638+
# error "__cpp_lib_constrained_equality should have the value 202411L in c++26"
66456639
# endif
66466640

66476641
# ifndef __cpp_lib_containers_ranges

libcxx/utils/generate_feature_test_macro_components.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -442,11 +442,9 @@ def add_version_header(tc):
442442
{
443443
"name": "__cpp_lib_constrained_equality",
444444
"values": {
445-
# "c++26": 202403, # P2944R3: Comparisons for reference_wrapper
446445
"c++26": 202411, # P3379R0: Constrain std::expected equality operators
447446
},
448447
"headers": ["expected", "optional", "tuple", "utility", "variant"],
449-
"unimplemented": True,
450448
},
451449
{
452450
"name": "__cpp_lib_containers_ranges",

0 commit comments

Comments
 (0)