Skip to content

Commit 1a03f7e

Browse files
committed
[libc++] Follow-up to "Poison Pills are Too Toxic"
1 parent edf733b commit 1a03f7e

12 files changed

+44
-28
lines changed

libcxx/docs/FeatureTestMacroTable.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,8 @@ Status
348348
---------------------------------------------------------- -----------------
349349
``__cpp_lib_print`` ``202207L``
350350
---------------------------------------------------------- -----------------
351+
``__cpp_lib_ranges`` ``202211L``
352+
---------------------------------------------------------- -----------------
351353
``__cpp_lib_ranges_as_const`` *unimplemented*
352354
---------------------------------------------------------- -----------------
353355
``__cpp_lib_ranges_as_rvalue`` ``202207L``

libcxx/docs/ReleaseNotes/19.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ Implemented Papers
5050
- P1659R3 - ``std::ranges::starts_with`` and ``std::ranges::ends_with``
5151
- P3029R1 - Better ``mdspan``'s CTAD
5252
- P2387R3 - Pipe support for user-defined range adaptors
53+
- P2602R2 - Poison Pills are Too Toxic (as DR against C++20)
5354

5455
Improvements and New Features
5556
-----------------------------

libcxx/docs/Status/Cxx23.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,9 @@ Paper Status
4444
.. [#note-P1413R3] P1413R3: ``std::aligned_storage_t`` and ``std::aligned_union_t`` are marked deprecated, but
4545
clang doesn't issue a diagnostic for deprecated using template declarations.
4646
.. [#note-P2520R0] P2520R0: Libc++ implemented this paper as a DR in C++20 as well.
47-
.. [#note-P2711R1] P2711R1: ``join_with_view`` hasn't been done yet since this type isn't implemented yet.
47+
.. [#note-P2602R2] P2602R2: Libc++ implemented this paper as a DR in C++20 as well.
4848
.. [#note-P2770R0] P2770R0: ``join_with_view`` hasn't been done yet since this type isn't implemented yet.
49+
.. [#note-P2711R1] P2711R1: ``join_with_view`` hasn't been done yet since this type isn't implemented yet.
4950
.. [#note-P2693R1] P2693R1: The formatter for ``std::thread::id`` is implemented.
5051
The formatter for ``stacktrace`` is not implemented, since ``stacktrace`` is
5152
not implemented yet.

libcxx/docs/Status/Cxx23Papers.csv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@
100100
"`P2396R1 <https://wg21.link/P2396R1>`__","LWG", "Concurrency TS 2 fixes ", "November 2022","","","|concurrency TS|"
101101
"`P2505R5 <https://wg21.link/P2505R5>`__","LWG", "Monadic Functions for ``std::expected``", "November 2022","|Complete|","17.0",""
102102
"`P2539R4 <https://wg21.link/P2539R4>`__","LWG", "Should the output of ``std::print`` to a terminal be synchronized with the underlying stream?", "November 2022","|Complete|","18.0","|format|"
103-
"`P2602R2 <https://wg21.link/P2602R2>`__","LWG", "Poison Pills are Too Toxic", "November 2022","|Complete|","19.0","|ranges|"
103+
"`P2602R2 <https://wg21.link/P2602R2>`__","LWG", "Poison Pills are Too Toxic", "November 2022","|Complete| [#note-P2602R2]_","19.0","|ranges| |DR|"
104104
"`P2708R1 <https://wg21.link/P2708R1>`__","LWG", "No Further Fundamentals TSes", "November 2022","|Nothing to do|","",""
105105
"","","","","","",""
106106
"`P0290R4 <https://wg21.link/P0290R4>`__","LWG", "``apply()`` for ``synchronized_value<T>``","February 2023","","","|concurrency TS|"

libcxx/include/version

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,8 +171,9 @@ __cpp_lib_parallel_algorithm 201603L <algorithm> <num
171171
__cpp_lib_polymorphic_allocator 201902L <memory_resource>
172172
__cpp_lib_print 202207L <ostream> <print>
173173
__cpp_lib_quoted_string_io 201304L <iomanip>
174-
__cpp_lib_ranges 202207L <algorithm> <functional> <iterator>
174+
__cpp_lib_ranges 202211L <algorithm> <functional> <iterator>
175175
<memory> <ranges>
176+
202207L // C++20
176177
__cpp_lib_ranges_as_const 202207L <ranges>
177178
__cpp_lib_ranges_as_rvalue 202207L <ranges>
178179
__cpp_lib_ranges_chunk 202202L <ranges>
@@ -470,6 +471,8 @@ __cpp_lib_within_lifetime 202306L <type_traits>
470471
# define __cpp_lib_optional 202110L
471472
// # define __cpp_lib_out_ptr 202106L
472473
# define __cpp_lib_print 202207L
474+
# undef __cpp_lib_ranges
475+
# define __cpp_lib_ranges 202211L
473476
// # define __cpp_lib_ranges_as_const 202207L
474477
# define __cpp_lib_ranges_as_rvalue 202207L
475478
// # define __cpp_lib_ranges_chunk 202202L

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

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
__cpp_lib_freestanding_algorithm 202311L [C++26]
2323
__cpp_lib_parallel_algorithm 201603L [C++17]
2424
__cpp_lib_ranges 202207L [C++20]
25+
202211L [C++23]
2526
__cpp_lib_ranges_contains 202207L [C++23]
2627
__cpp_lib_ranges_starts_ends_with 202106L [C++23]
2728
__cpp_lib_robust_nonmodifying_seq_ops 201304L [C++14]
@@ -304,8 +305,8 @@
304305
# ifndef __cpp_lib_ranges
305306
# error "__cpp_lib_ranges should be defined in c++23"
306307
# endif
307-
# if __cpp_lib_ranges != 202207L
308-
# error "__cpp_lib_ranges should have the value 202207L in c++23"
308+
# if __cpp_lib_ranges != 202211L
309+
# error "__cpp_lib_ranges should have the value 202211L in c++23"
309310
# endif
310311

311312
# ifndef __cpp_lib_ranges_contains
@@ -401,8 +402,8 @@
401402
# ifndef __cpp_lib_ranges
402403
# error "__cpp_lib_ranges should be defined in c++26"
403404
# endif
404-
# if __cpp_lib_ranges != 202207L
405-
# error "__cpp_lib_ranges should have the value 202207L in c++26"
405+
# if __cpp_lib_ranges != 202211L
406+
# error "__cpp_lib_ranges should have the value 202211L in c++26"
406407
# endif
407408

408409
# ifndef __cpp_lib_ranges_contains

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

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
__cpp_lib_move_only_function 202110L [C++23]
2929
__cpp_lib_not_fn 201603L [C++17]
3030
__cpp_lib_ranges 202207L [C++20]
31+
202211L [C++23]
3132
__cpp_lib_reference_wrapper 202403L [C++26]
3233
__cpp_lib_result_of_sfinae 201210L [C++14]
3334
__cpp_lib_transparent_operators 201210L [C++14]
@@ -409,8 +410,8 @@
409410
# ifndef __cpp_lib_ranges
410411
# error "__cpp_lib_ranges should be defined in c++23"
411412
# endif
412-
# if __cpp_lib_ranges != 202207L
413-
# error "__cpp_lib_ranges should have the value 202207L in c++23"
413+
# if __cpp_lib_ranges != 202211L
414+
# error "__cpp_lib_ranges should have the value 202211L in c++23"
414415
# endif
415416

416417
# ifdef __cpp_lib_reference_wrapper
@@ -531,8 +532,8 @@
531532
# ifndef __cpp_lib_ranges
532533
# error "__cpp_lib_ranges should be defined in c++26"
533534
# endif
534-
# if __cpp_lib_ranges != 202207L
535-
# error "__cpp_lib_ranges should have the value 202207L in c++26"
535+
# if __cpp_lib_ranges != 202211L
536+
# error "__cpp_lib_ranges should have the value 202211L in c++26"
536537
# endif
537538

538539
# if !defined(_LIBCPP_VERSION)

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

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
__cpp_lib_nonmember_container_access 201411L [C++17]
2525
__cpp_lib_null_iterators 201304L [C++14]
2626
__cpp_lib_ranges 202207L [C++20]
27+
202211L [C++23]
2728
__cpp_lib_ssize 201902L [C++20]
2829
*/
2930

@@ -255,8 +256,8 @@
255256
# ifndef __cpp_lib_ranges
256257
# error "__cpp_lib_ranges should be defined in c++23"
257258
# endif
258-
# if __cpp_lib_ranges != 202207L
259-
# error "__cpp_lib_ranges should have the value 202207L in c++23"
259+
# if __cpp_lib_ranges != 202211L
260+
# error "__cpp_lib_ranges should have the value 202211L in c++23"
260261
# endif
261262

262263
# ifndef __cpp_lib_ssize
@@ -313,8 +314,8 @@
313314
# ifndef __cpp_lib_ranges
314315
# error "__cpp_lib_ranges should be defined in c++26"
315316
# endif
316-
# if __cpp_lib_ranges != 202207L
317-
# error "__cpp_lib_ranges should have the value 202207L in c++26"
317+
# if __cpp_lib_ranges != 202211L
318+
# error "__cpp_lib_ranges should have the value 202211L in c++26"
318319
# endif
319320

320321
# ifndef __cpp_lib_ssize

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

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
__cpp_lib_out_ptr 202106L [C++23]
3030
202311L [C++26]
3131
__cpp_lib_ranges 202207L [C++20]
32+
202211L [C++23]
3233
__cpp_lib_raw_memory_algorithms 201606L [C++17]
3334
__cpp_lib_shared_ptr_arrays 201611L [C++17]
3435
201707L [C++20]
@@ -501,8 +502,8 @@
501502
# ifndef __cpp_lib_ranges
502503
# error "__cpp_lib_ranges should be defined in c++23"
503504
# endif
504-
# if __cpp_lib_ranges != 202207L
505-
# error "__cpp_lib_ranges should have the value 202207L in c++23"
505+
# if __cpp_lib_ranges != 202211L
506+
# error "__cpp_lib_ranges should have the value 202211L in c++23"
506507
# endif
507508

508509
# ifndef __cpp_lib_raw_memory_algorithms
@@ -638,8 +639,8 @@
638639
# ifndef __cpp_lib_ranges
639640
# error "__cpp_lib_ranges should be defined in c++26"
640641
# endif
641-
# if __cpp_lib_ranges != 202207L
642-
# error "__cpp_lib_ranges should have the value 202207L in c++26"
642+
# if __cpp_lib_ranges != 202211L
643+
# error "__cpp_lib_ranges should have the value 202211L in c++26"
643644
# endif
644645

645646
# ifndef __cpp_lib_raw_memory_algorithms

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

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
/* Constant Value
1919
__cpp_lib_default_template_type_for_algorithm_values 202403L [C++26]
2020
__cpp_lib_ranges 202207L [C++20]
21+
202211L [C++23]
2122
__cpp_lib_ranges_as_const 202207L [C++23]
2223
__cpp_lib_ranges_as_rvalue 202207L [C++23]
2324
__cpp_lib_ranges_chunk 202202L [C++23]
@@ -245,8 +246,8 @@
245246
# ifndef __cpp_lib_ranges
246247
# error "__cpp_lib_ranges should be defined in c++23"
247248
# endif
248-
# if __cpp_lib_ranges != 202207L
249-
# error "__cpp_lib_ranges should have the value 202207L in c++23"
249+
# if __cpp_lib_ranges != 202211L
250+
# error "__cpp_lib_ranges should have the value 202211L in c++23"
250251
# endif
251252

252253
# if !defined(_LIBCPP_VERSION)
@@ -364,8 +365,8 @@
364365
# ifndef __cpp_lib_ranges
365366
# error "__cpp_lib_ranges should be defined in c++26"
366367
# endif
367-
# if __cpp_lib_ranges != 202207L
368-
# error "__cpp_lib_ranges should have the value 202207L in c++26"
368+
# if __cpp_lib_ranges != 202211L
369+
# error "__cpp_lib_ranges should have the value 202211L in c++26"
369370
# endif
370371

371372
# if !defined(_LIBCPP_VERSION)

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

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@
158158
__cpp_lib_print 202207L [C++23]
159159
__cpp_lib_quoted_string_io 201304L [C++14]
160160
__cpp_lib_ranges 202207L [C++20]
161+
202211L [C++23]
161162
__cpp_lib_ranges_as_const 202207L [C++23]
162163
__cpp_lib_ranges_as_rvalue 202207L [C++23]
163164
__cpp_lib_ranges_chunk 202202L [C++23]
@@ -5471,8 +5472,8 @@
54715472
# ifndef __cpp_lib_ranges
54725473
# error "__cpp_lib_ranges should be defined in c++23"
54735474
# endif
5474-
# if __cpp_lib_ranges != 202207L
5475-
# error "__cpp_lib_ranges should have the value 202207L in c++23"
5475+
# if __cpp_lib_ranges != 202211L
5476+
# error "__cpp_lib_ranges should have the value 202211L in c++23"
54765477
# endif
54775478

54785479
# if !defined(_LIBCPP_VERSION)
@@ -7256,8 +7257,8 @@
72567257
# ifndef __cpp_lib_ranges
72577258
# error "__cpp_lib_ranges should be defined in c++26"
72587259
# endif
7259-
# if __cpp_lib_ranges != 202207L
7260-
# error "__cpp_lib_ranges should have the value 202207L in c++26"
7260+
# if __cpp_lib_ranges != 202211L
7261+
# error "__cpp_lib_ranges should have the value 202211L in c++26"
72617262
# endif
72627263

72637264
# if !defined(_LIBCPP_VERSION)

libcxx/utils/generate_feature_test_macro_components.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -921,7 +921,10 @@ def add_version_header(tc):
921921
},
922922
{
923923
"name": "__cpp_lib_ranges",
924-
"values": {"c++20": 202207},
924+
"values": {
925+
"c++20": 202207,
926+
"c++23": 202211, # P2602R2 Poison Pills are Too Toxic
927+
},
925928
"headers": ["algorithm", "functional", "iterator", "memory", "ranges"],
926929
},
927930
{

0 commit comments

Comments
 (0)