Skip to content

Commit bb606ca

Browse files
ldionnetru
authored andcommitted
[libc++] Adjust the version of __cpp_lib_ranges in C++20 mode
This is a (very partial) cherry-pick of #101715 to fix this oversight in the LLVM 19 release.
1 parent 1720219 commit bb606ca

9 files changed

+46
-46
lines changed

libcxx/docs/FeatureTestMacroTable.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ Status
266266
---------------------------------------------------------- -----------------
267267
``__cpp_lib_polymorphic_allocator`` ``201902L``
268268
---------------------------------------------------------- -----------------
269-
``__cpp_lib_ranges`` ``202207L``
269+
``__cpp_lib_ranges`` ``202110L``
270270
---------------------------------------------------------- -----------------
271271
``__cpp_lib_remove_cvref`` ``201711L``
272272
---------------------------------------------------------- -----------------

libcxx/include/version

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ __cpp_lib_philox_engine 202406L <random>
182182
__cpp_lib_polymorphic_allocator 201902L <memory_resource>
183183
__cpp_lib_print 202207L <ostream> <print>
184184
__cpp_lib_quoted_string_io 201304L <iomanip>
185-
__cpp_lib_ranges 202207L <algorithm> <functional> <iterator>
185+
__cpp_lib_ranges 202110L <algorithm> <functional> <iterator>
186186
<memory> <ranges>
187187
__cpp_lib_ranges_as_const 202207L <ranges>
188188
__cpp_lib_ranges_as_rvalue 202207L <ranges>
@@ -428,7 +428,7 @@ __cpp_lib_void_t 201411L <type_traits>
428428
# if _LIBCPP_AVAILABILITY_HAS_PMR
429429
# define __cpp_lib_polymorphic_allocator 201902L
430430
# endif
431-
# define __cpp_lib_ranges 202207L
431+
# define __cpp_lib_ranges 202110L
432432
# define __cpp_lib_remove_cvref 201711L
433433
# if !defined(_LIBCPP_HAS_NO_THREADS) && _LIBCPP_AVAILABILITY_HAS_SYNC
434434
# define __cpp_lib_semaphore 201907L

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
__cpp_lib_default_template_type_for_algorithm_values 202403L [C++26]
2222
__cpp_lib_freestanding_algorithm 202311L [C++26]
2323
__cpp_lib_parallel_algorithm 201603L [C++17]
24-
__cpp_lib_ranges 202207L [C++20]
24+
__cpp_lib_ranges 202110L [C++20]
2525
__cpp_lib_ranges_contains 202207L [C++23]
2626
__cpp_lib_ranges_find_last 202207L [C++23]
2727
__cpp_lib_ranges_starts_ends_with 202106L [C++23]
@@ -244,8 +244,8 @@
244244
# ifndef __cpp_lib_ranges
245245
# error "__cpp_lib_ranges should be defined in c++20"
246246
# endif
247-
# if __cpp_lib_ranges != 202207L
248-
# error "__cpp_lib_ranges should have the value 202207L in c++20"
247+
# if __cpp_lib_ranges != 202110L
248+
# error "__cpp_lib_ranges should have the value 202110L in c++20"
249249
# endif
250250

251251
# ifdef __cpp_lib_ranges_contains
@@ -321,8 +321,8 @@
321321
# ifndef __cpp_lib_ranges
322322
# error "__cpp_lib_ranges should be defined in c++23"
323323
# endif
324-
# if __cpp_lib_ranges != 202207L
325-
# error "__cpp_lib_ranges should have the value 202207L in c++23"
324+
# if __cpp_lib_ranges != 202110L
325+
# error "__cpp_lib_ranges should have the value 202110L in c++23"
326326
# endif
327327

328328
# ifndef __cpp_lib_ranges_contains
@@ -425,8 +425,8 @@
425425
# ifndef __cpp_lib_ranges
426426
# error "__cpp_lib_ranges should be defined in c++26"
427427
# endif
428-
# if __cpp_lib_ranges != 202207L
429-
# error "__cpp_lib_ranges should have the value 202207L in c++26"
428+
# if __cpp_lib_ranges != 202110L
429+
# error "__cpp_lib_ranges should have the value 202110L in c++26"
430430
# endif
431431

432432
# ifndef __cpp_lib_ranges_contains

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
__cpp_lib_invoke_r 202106L [C++23]
2828
__cpp_lib_move_only_function 202110L [C++23]
2929
__cpp_lib_not_fn 201603L [C++17]
30-
__cpp_lib_ranges 202207L [C++20]
30+
__cpp_lib_ranges 202110L [C++20]
3131
__cpp_lib_reference_wrapper 202403L [C++26]
3232
__cpp_lib_result_of_sfinae 201210L [C++14]
3333
__cpp_lib_transparent_operators 201210L [C++14]
@@ -305,8 +305,8 @@
305305
# ifndef __cpp_lib_ranges
306306
# error "__cpp_lib_ranges should be defined in c++20"
307307
# endif
308-
# if __cpp_lib_ranges != 202207L
309-
# error "__cpp_lib_ranges should have the value 202207L in c++20"
308+
# if __cpp_lib_ranges != 202110L
309+
# error "__cpp_lib_ranges should have the value 202110L in c++20"
310310
# endif
311311

312312
# ifdef __cpp_lib_reference_wrapper
@@ -409,8 +409,8 @@
409409
# ifndef __cpp_lib_ranges
410410
# error "__cpp_lib_ranges should be defined in c++23"
411411
# endif
412-
# if __cpp_lib_ranges != 202207L
413-
# error "__cpp_lib_ranges should have the value 202207L in c++23"
412+
# if __cpp_lib_ranges != 202110L
413+
# error "__cpp_lib_ranges should have the value 202110L in c++23"
414414
# endif
415415

416416
# ifdef __cpp_lib_reference_wrapper
@@ -531,8 +531,8 @@
531531
# ifndef __cpp_lib_ranges
532532
# error "__cpp_lib_ranges should be defined in c++26"
533533
# endif
534-
# if __cpp_lib_ranges != 202207L
535-
# error "__cpp_lib_ranges should have the value 202207L in c++26"
534+
# if __cpp_lib_ranges != 202110L
535+
# error "__cpp_lib_ranges should have the value 202110L in c++26"
536536
# endif
537537

538538
# ifndef __cpp_lib_reference_wrapper

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
__cpp_lib_move_iterator_concept 202207L [C++20]
2424
__cpp_lib_nonmember_container_access 201411L [C++17]
2525
__cpp_lib_null_iterators 201304L [C++14]
26-
__cpp_lib_ranges 202207L [C++20]
26+
__cpp_lib_ranges 202110L [C++20]
2727
__cpp_lib_ssize 201902L [C++20]
2828
*/
2929

@@ -197,8 +197,8 @@
197197
# ifndef __cpp_lib_ranges
198198
# error "__cpp_lib_ranges should be defined in c++20"
199199
# endif
200-
# if __cpp_lib_ranges != 202207L
201-
# error "__cpp_lib_ranges should have the value 202207L in c++20"
200+
# if __cpp_lib_ranges != 202110L
201+
# error "__cpp_lib_ranges should have the value 202110L in c++20"
202202
# endif
203203

204204
# ifndef __cpp_lib_ssize
@@ -255,8 +255,8 @@
255255
# ifndef __cpp_lib_ranges
256256
# error "__cpp_lib_ranges should be defined in c++23"
257257
# endif
258-
# if __cpp_lib_ranges != 202207L
259-
# error "__cpp_lib_ranges should have the value 202207L in c++23"
258+
# if __cpp_lib_ranges != 202110L
259+
# error "__cpp_lib_ranges should have the value 202110L in c++23"
260260
# endif
261261

262262
# ifndef __cpp_lib_ssize
@@ -313,8 +313,8 @@
313313
# ifndef __cpp_lib_ranges
314314
# error "__cpp_lib_ranges should be defined in c++26"
315315
# endif
316-
# if __cpp_lib_ranges != 202207L
317-
# error "__cpp_lib_ranges should have the value 202207L in c++26"
316+
# if __cpp_lib_ranges != 202110L
317+
# error "__cpp_lib_ranges should have the value 202110L in c++26"
318318
# endif
319319

320320
# ifndef __cpp_lib_ssize

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
__cpp_lib_make_unique 201304L [C++14]
2929
__cpp_lib_out_ptr 202106L [C++23]
3030
202311L [C++26]
31-
__cpp_lib_ranges 202207L [C++20]
31+
__cpp_lib_ranges 202110L [C++20]
3232
__cpp_lib_raw_memory_algorithms 201606L [C++17]
3333
__cpp_lib_shared_ptr_arrays 201611L [C++17]
3434
201707L [C++20]
@@ -364,8 +364,8 @@
364364
# ifndef __cpp_lib_ranges
365365
# error "__cpp_lib_ranges should be defined in c++20"
366366
# endif
367-
# if __cpp_lib_ranges != 202207L
368-
# error "__cpp_lib_ranges should have the value 202207L in c++20"
367+
# if __cpp_lib_ranges != 202110L
368+
# error "__cpp_lib_ranges should have the value 202110L in c++20"
369369
# endif
370370

371371
# ifndef __cpp_lib_raw_memory_algorithms
@@ -495,8 +495,8 @@
495495
# ifndef __cpp_lib_ranges
496496
# error "__cpp_lib_ranges should be defined in c++23"
497497
# endif
498-
# if __cpp_lib_ranges != 202207L
499-
# error "__cpp_lib_ranges should have the value 202207L in c++23"
498+
# if __cpp_lib_ranges != 202110L
499+
# error "__cpp_lib_ranges should have the value 202110L in c++23"
500500
# endif
501501

502502
# ifndef __cpp_lib_raw_memory_algorithms
@@ -626,8 +626,8 @@
626626
# ifndef __cpp_lib_ranges
627627
# error "__cpp_lib_ranges should be defined in c++26"
628628
# endif
629-
# if __cpp_lib_ranges != 202207L
630-
# error "__cpp_lib_ranges should have the value 202207L in c++26"
629+
# if __cpp_lib_ranges != 202110L
630+
# error "__cpp_lib_ranges should have the value 202110L in c++26"
631631
# endif
632632

633633
# ifndef __cpp_lib_raw_memory_algorithms

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
/* Constant Value
1919
__cpp_lib_default_template_type_for_algorithm_values 202403L [C++26]
20-
__cpp_lib_ranges 202207L [C++20]
20+
__cpp_lib_ranges 202110L [C++20]
2121
__cpp_lib_ranges_as_const 202207L [C++23]
2222
__cpp_lib_ranges_as_rvalue 202207L [C++23]
2323
__cpp_lib_ranges_chunk 202202L [C++23]
@@ -192,8 +192,8 @@
192192
# ifndef __cpp_lib_ranges
193193
# error "__cpp_lib_ranges should be defined in c++20"
194194
# endif
195-
# if __cpp_lib_ranges != 202207L
196-
# error "__cpp_lib_ranges should have the value 202207L in c++20"
195+
# if __cpp_lib_ranges != 202110L
196+
# error "__cpp_lib_ranges should have the value 202110L in c++20"
197197
# endif
198198

199199
# ifdef __cpp_lib_ranges_as_const
@@ -245,8 +245,8 @@
245245
# ifndef __cpp_lib_ranges
246246
# error "__cpp_lib_ranges should be defined in c++23"
247247
# endif
248-
# if __cpp_lib_ranges != 202207L
249-
# error "__cpp_lib_ranges should have the value 202207L in c++23"
248+
# if __cpp_lib_ranges != 202110L
249+
# error "__cpp_lib_ranges should have the value 202110L in c++23"
250250
# endif
251251

252252
# if !defined(_LIBCPP_VERSION)
@@ -364,8 +364,8 @@
364364
# ifndef __cpp_lib_ranges
365365
# error "__cpp_lib_ranges should be defined in c++26"
366366
# endif
367-
# if __cpp_lib_ranges != 202207L
368-
# error "__cpp_lib_ranges should have the value 202207L in c++26"
367+
# if __cpp_lib_ranges != 202110L
368+
# error "__cpp_lib_ranges should have the value 202110L in c++26"
369369
# endif
370370

371371
# if !defined(_LIBCPP_VERSION)

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@
166166
__cpp_lib_polymorphic_allocator 201902L [C++20]
167167
__cpp_lib_print 202207L [C++23]
168168
__cpp_lib_quoted_string_io 201304L [C++14]
169-
__cpp_lib_ranges 202207L [C++20]
169+
__cpp_lib_ranges 202110L [C++20]
170170
__cpp_lib_ranges_as_const 202207L [C++23]
171171
__cpp_lib_ranges_as_rvalue 202207L [C++23]
172172
__cpp_lib_ranges_chunk 202202L [C++23]
@@ -4131,8 +4131,8 @@
41314131
# ifndef __cpp_lib_ranges
41324132
# error "__cpp_lib_ranges should be defined in c++20"
41334133
# endif
4134-
# if __cpp_lib_ranges != 202207L
4135-
# error "__cpp_lib_ranges should have the value 202207L in c++20"
4134+
# if __cpp_lib_ranges != 202110L
4135+
# error "__cpp_lib_ranges should have the value 202110L in c++20"
41364136
# endif
41374137

41384138
# ifdef __cpp_lib_ranges_as_const
@@ -5619,8 +5619,8 @@
56195619
# ifndef __cpp_lib_ranges
56205620
# error "__cpp_lib_ranges should be defined in c++23"
56215621
# endif
5622-
# if __cpp_lib_ranges != 202207L
5623-
# error "__cpp_lib_ranges should have the value 202207L in c++23"
5622+
# if __cpp_lib_ranges != 202110L
5623+
# error "__cpp_lib_ranges should have the value 202110L in c++23"
56245624
# endif
56255625

56265626
# if !defined(_LIBCPP_VERSION)
@@ -7470,8 +7470,8 @@
74707470
# ifndef __cpp_lib_ranges
74717471
# error "__cpp_lib_ranges should be defined in c++26"
74727472
# endif
7473-
# if __cpp_lib_ranges != 202207L
7474-
# error "__cpp_lib_ranges should have the value 202207L in c++26"
7473+
# if __cpp_lib_ranges != 202110L
7474+
# error "__cpp_lib_ranges should have the value 202110L in c++26"
74757475
# endif
74767476

74777477
# if !defined(_LIBCPP_VERSION)

libcxx/utils/generate_feature_test_macro_components.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -991,7 +991,7 @@ def add_version_header(tc):
991991
{
992992
"name": "__cpp_lib_ranges",
993993
"values": {
994-
"c++20": 202207,
994+
"c++20": 202110, # P2415R2 What is a view?
995995
# "c++23": 202302, # Relaxing Ranges Just A Smidge
996996
# "c++26": 202406, # P2997R1 Removing the common reference requirement from the indirectly invocable concepts (already implemented as a DR)
997997
},

0 commit comments

Comments
 (0)