Skip to content

Commit 1360969

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

9 files changed

+22
-22
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
@@ -184,7 +184,7 @@ __cpp_lib_print 202207L <ostream> <print
184184
__cpp_lib_quoted_string_io 201304L <iomanip>
185185
__cpp_lib_ranges 202211L <algorithm> <functional> <iterator>
186186
<memory> <ranges>
187-
202207L // C++20
187+
202110L // C++20
188188
__cpp_lib_ranges_as_const 202207L <ranges>
189189
__cpp_lib_ranges_as_rvalue 202207L <ranges>
190190
__cpp_lib_ranges_chunk 202202L <ranges>
@@ -429,7 +429,7 @@ __cpp_lib_void_t 201411L <type_traits>
429429
# if _LIBCPP_AVAILABILITY_HAS_PMR
430430
# define __cpp_lib_polymorphic_allocator 201902L
431431
# endif
432-
# define __cpp_lib_ranges 202207L
432+
# define __cpp_lib_ranges 202110L
433433
# define __cpp_lib_remove_cvref 201711L
434434
# if !defined(_LIBCPP_HAS_NO_THREADS) && _LIBCPP_AVAILABILITY_HAS_SYNC
435435
# define __cpp_lib_semaphore 201907L

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

Lines changed: 3 additions & 3 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
202211L [C++23]
2626
__cpp_lib_ranges_contains 202207L [C++23]
2727
__cpp_lib_ranges_find_last 202207L [C++23]
@@ -245,8 +245,8 @@
245245
# ifndef __cpp_lib_ranges
246246
# error "__cpp_lib_ranges should be defined in c++20"
247247
# endif
248-
# if __cpp_lib_ranges != 202207L
249-
# error "__cpp_lib_ranges should have the value 202207L in c++20"
248+
# if __cpp_lib_ranges != 202110L
249+
# error "__cpp_lib_ranges should have the value 202110L in c++20"
250250
# endif
251251

252252
# ifdef __cpp_lib_ranges_contains

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

Lines changed: 3 additions & 3 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
202211L [C++23]
3232
__cpp_lib_reference_wrapper 202403L [C++26]
3333
__cpp_lib_result_of_sfinae 201210L [C++14]
@@ -306,8 +306,8 @@
306306
# ifndef __cpp_lib_ranges
307307
# error "__cpp_lib_ranges should be defined in c++20"
308308
# endif
309-
# if __cpp_lib_ranges != 202207L
310-
# error "__cpp_lib_ranges should have the value 202207L in c++20"
309+
# if __cpp_lib_ranges != 202110L
310+
# error "__cpp_lib_ranges should have the value 202110L in c++20"
311311
# endif
312312

313313
# ifdef __cpp_lib_reference_wrapper

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

Lines changed: 3 additions & 3 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
202211L [C++23]
2828
__cpp_lib_ssize 201902L [C++20]
2929
*/
@@ -198,8 +198,8 @@
198198
# ifndef __cpp_lib_ranges
199199
# error "__cpp_lib_ranges should be defined in c++20"
200200
# endif
201-
# if __cpp_lib_ranges != 202207L
202-
# error "__cpp_lib_ranges should have the value 202207L in c++20"
201+
# if __cpp_lib_ranges != 202110L
202+
# error "__cpp_lib_ranges should have the value 202110L in c++20"
203203
# endif
204204

205205
# ifndef __cpp_lib_ssize

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

Lines changed: 3 additions & 3 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
202211L [C++23]
3333
__cpp_lib_raw_memory_algorithms 201606L [C++17]
3434
__cpp_lib_shared_ptr_arrays 201611L [C++17]
@@ -365,8 +365,8 @@
365365
# ifndef __cpp_lib_ranges
366366
# error "__cpp_lib_ranges should be defined in c++20"
367367
# endif
368-
# if __cpp_lib_ranges != 202207L
369-
# error "__cpp_lib_ranges should have the value 202207L in c++20"
368+
# if __cpp_lib_ranges != 202110L
369+
# error "__cpp_lib_ranges should have the value 202110L in c++20"
370370
# endif
371371

372372
# ifndef __cpp_lib_raw_memory_algorithms

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

Lines changed: 3 additions & 3 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
202211L [C++23]
2222
__cpp_lib_ranges_as_const 202207L [C++23]
2323
__cpp_lib_ranges_as_rvalue 202207L [C++23]
@@ -193,8 +193,8 @@
193193
# ifndef __cpp_lib_ranges
194194
# error "__cpp_lib_ranges should be defined in c++20"
195195
# endif
196-
# if __cpp_lib_ranges != 202207L
197-
# error "__cpp_lib_ranges should have the value 202207L in c++20"
196+
# if __cpp_lib_ranges != 202110L
197+
# error "__cpp_lib_ranges should have the value 202110L in c++20"
198198
# endif
199199

200200
# ifdef __cpp_lib_ranges_as_const

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

Lines changed: 3 additions & 3 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
202211L [C++23]
171171
__cpp_lib_ranges_as_const 202207L [C++23]
172172
__cpp_lib_ranges_as_rvalue 202207L [C++23]
@@ -4132,8 +4132,8 @@
41324132
# ifndef __cpp_lib_ranges
41334133
# error "__cpp_lib_ranges should be defined in c++20"
41344134
# endif
4135-
# if __cpp_lib_ranges != 202207L
4136-
# error "__cpp_lib_ranges should have the value 202207L in c++20"
4135+
# if __cpp_lib_ranges != 202110L
4136+
# error "__cpp_lib_ranges should have the value 202110L in c++20"
41374137
# endif
41384138

41394139
# ifdef __cpp_lib_ranges_as_const

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": 202211, # P2602R2 Poison Pills are Too Toxic
996996
# "c++23": 202302, # Relaxing Ranges Just A Smidge
997997
# "c++26": 202406, # P2997R1 Removing the common reference requirement from the indirectly invocable concepts (already implemented as a DR)

0 commit comments

Comments
 (0)