Skip to content

Commit 9375902

Browse files
committed
[libc++] Follow-up to "Poison Pills are Too Toxic"
* Some docs should've been updated in #74534, this PR does this. * #89148 should've bumped `__cpp_lib_ranges` macro to 202211 (value mentioned by "P2602R2 Poison Pills are Too Toxic") * Drive-by: fix order of notes in `Cxx23.rst`
1 parent 8b7f178 commit 9375902

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
@@ -350,6 +350,8 @@ Status
350350
---------------------------------------------------------- -----------------
351351
``__cpp_lib_print`` ``202207L``
352352
---------------------------------------------------------- -----------------
353+
``__cpp_lib_ranges`` ``202211L``
354+
---------------------------------------------------------- -----------------
353355
``__cpp_lib_ranges_as_const`` *unimplemented*
354356
---------------------------------------------------------- -----------------
355357
``__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
@@ -53,6 +53,7 @@ Implemented Papers
5353
- P2387R3 - Pipe support for user-defined range adaptors
5454
- P2713R1 - Escaping improvements in ``std::format``
5555
- P2231R1 - Missing ``constexpr`` in ``std::optional`` and ``std::variant``
56+
- P2602R2 - Poison Pills are Too Toxic (as DR against C++20)
5657

5758
Improvements and New Features
5859
-----------------------------

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
@@ -175,8 +175,9 @@ __cpp_lib_parallel_algorithm 201603L <algorithm> <num
175175
__cpp_lib_polymorphic_allocator 201902L <memory_resource>
176176
__cpp_lib_print 202207L <ostream> <print>
177177
__cpp_lib_quoted_string_io 201304L <iomanip>
178-
__cpp_lib_ranges 202207L <algorithm> <functional> <iterator>
178+
__cpp_lib_ranges 202211L <algorithm> <functional> <iterator>
179179
<memory> <ranges>
180+
202207L // C++20
180181
__cpp_lib_ranges_as_const 202207L <ranges>
181182
__cpp_lib_ranges_as_rvalue 202207L <ranges>
182183
__cpp_lib_ranges_chunk 202202L <ranges>
@@ -472,6 +473,8 @@ __cpp_lib_within_lifetime 202306L <type_traits>
472473
# define __cpp_lib_optional 202110L
473474
// # define __cpp_lib_out_ptr 202106L
474475
# define __cpp_lib_print 202207L
476+
# undef __cpp_lib_ranges
477+
# define __cpp_lib_ranges 202211L
475478
// # define __cpp_lib_ranges_as_const 202207L
476479
# define __cpp_lib_ranges_as_rvalue 202207L
477480
// # 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
# ifndef __cpp_lib_reference_wrapper

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
@@ -159,6 +159,7 @@
159159
__cpp_lib_print 202207L [C++23]
160160
__cpp_lib_quoted_string_io 201304L [C++14]
161161
__cpp_lib_ranges 202207L [C++20]
162+
202211L [C++23]
162163
__cpp_lib_ranges_as_const 202207L [C++23]
163164
__cpp_lib_ranges_as_rvalue 202207L [C++23]
164165
__cpp_lib_ranges_chunk 202202L [C++23]
@@ -5495,8 +5496,8 @@
54955496
# ifndef __cpp_lib_ranges
54965497
# error "__cpp_lib_ranges should be defined in c++23"
54975498
# endif
5498-
# if __cpp_lib_ranges != 202207L
5499-
# error "__cpp_lib_ranges should have the value 202207L in c++23"
5499+
# if __cpp_lib_ranges != 202211L
5500+
# error "__cpp_lib_ranges should have the value 202211L in c++23"
55005501
# endif
55015502

55025503
# if !defined(_LIBCPP_VERSION)
@@ -7287,8 +7288,8 @@
72877288
# ifndef __cpp_lib_ranges
72887289
# error "__cpp_lib_ranges should be defined in c++26"
72897290
# endif
7290-
# if __cpp_lib_ranges != 202207L
7291-
# error "__cpp_lib_ranges should have the value 202207L in c++26"
7291+
# if __cpp_lib_ranges != 202211L
7292+
# error "__cpp_lib_ranges should have the value 202211L in c++26"
72927293
# endif
72937294

72947295
# 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
@@ -938,7 +938,10 @@ def add_version_header(tc):
938938
},
939939
{
940940
"name": "__cpp_lib_ranges",
941-
"values": {"c++20": 202207},
941+
"values": {
942+
"c++20": 202207,
943+
"c++23": 202211, # P2602R2 Poison Pills are Too Toxic
944+
},
942945
"headers": ["algorithm", "functional", "iterator", "memory", "ranges"],
943946
},
944947
{

0 commit comments

Comments
 (0)