Skip to content

Commit 54dee0b

Browse files
philnik777tru
authored andcommitted
[libc++] Add FTM for views::as_rvalue
`views::as_rvalue` was implemented in D137637, but we forgot to set the feature test macro. Fixes #60986. Reviewed By: Mordante, #libc Spies: libcxx-commits, arichardson Differential Revision: https://reviews.llvm.org/D144781 (cherry picked from commit 3d4b7a6)
1 parent abf3297 commit 54dee0b

File tree

5 files changed

+56
-0
lines changed

5 files changed

+56
-0
lines changed

libcxx/docs/FeatureTestMacroTable.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -332,6 +332,8 @@ Status
332332
------------------------------------------------- -----------------
333333
``__cpp_lib_out_ptr`` *unimplemented*
334334
------------------------------------------------- -----------------
335+
``__cpp_lib_ranges_as_rvalue`` ``202207L``
336+
------------------------------------------------- -----------------
335337
``__cpp_lib_ranges_chunk`` *unimplemented*
336338
------------------------------------------------- -----------------
337339
``__cpp_lib_ranges_chunk_by`` *unimplemented*

libcxx/include/version

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ __cpp_lib_polymorphic_allocator 201902L <memory_resource
139139
__cpp_lib_quoted_string_io 201304L <iomanip>
140140
__cpp_lib_ranges 202106L <algorithm> <functional> <iterator>
141141
<memory> <ranges>
142+
__cpp_lib_ranges_as_rvalue 202207L <ranges>
142143
__cpp_lib_ranges_chunk 202202L <ranges>
143144
__cpp_lib_ranges_chunk_by 202202L <ranges>
144145
__cpp_lib_ranges_iota 202202L <numeric>
@@ -401,6 +402,7 @@ __cpp_lib_void_t 201411L <type_traits>
401402
# undef __cpp_lib_optional
402403
# define __cpp_lib_optional 202110L
403404
// # define __cpp_lib_out_ptr 202106L
405+
# define __cpp_lib_ranges_as_rvalue 202207L
404406
// # define __cpp_lib_ranges_chunk 202202L
405407
// # define __cpp_lib_ranges_chunk_by 202202L
406408
// # define __cpp_lib_ranges_iota 202202L

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

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

1818
/* Constant Value
1919
__cpp_lib_ranges 202106L [C++20]
20+
__cpp_lib_ranges_as_rvalue 202207L [C++2b]
2021
__cpp_lib_ranges_chunk 202202L [C++2b]
2122
__cpp_lib_ranges_chunk_by 202202L [C++2b]
2223
__cpp_lib_ranges_join_with 202202L [C++2b]
@@ -33,6 +34,10 @@
3334
# error "__cpp_lib_ranges should not be defined before c++20"
3435
# endif
3536

37+
# ifdef __cpp_lib_ranges_as_rvalue
38+
# error "__cpp_lib_ranges_as_rvalue should not be defined before c++2b"
39+
# endif
40+
3641
# ifdef __cpp_lib_ranges_chunk
3742
# error "__cpp_lib_ranges_chunk should not be defined before c++2b"
3843
# endif
@@ -59,6 +64,10 @@
5964
# error "__cpp_lib_ranges should not be defined before c++20"
6065
# endif
6166

67+
# ifdef __cpp_lib_ranges_as_rvalue
68+
# error "__cpp_lib_ranges_as_rvalue should not be defined before c++2b"
69+
# endif
70+
6271
# ifdef __cpp_lib_ranges_chunk
6372
# error "__cpp_lib_ranges_chunk should not be defined before c++2b"
6473
# endif
@@ -85,6 +94,10 @@
8594
# error "__cpp_lib_ranges should not be defined before c++20"
8695
# endif
8796

97+
# ifdef __cpp_lib_ranges_as_rvalue
98+
# error "__cpp_lib_ranges_as_rvalue should not be defined before c++2b"
99+
# endif
100+
88101
# ifdef __cpp_lib_ranges_chunk
89102
# error "__cpp_lib_ranges_chunk should not be defined before c++2b"
90103
# endif
@@ -114,6 +127,10 @@
114127
# error "__cpp_lib_ranges should have the value 202106L in c++20"
115128
# endif
116129

130+
# ifdef __cpp_lib_ranges_as_rvalue
131+
# error "__cpp_lib_ranges_as_rvalue should not be defined before c++2b"
132+
# endif
133+
117134
# ifdef __cpp_lib_ranges_chunk
118135
# error "__cpp_lib_ranges_chunk should not be defined before c++2b"
119136
# endif
@@ -143,6 +160,13 @@
143160
# error "__cpp_lib_ranges should have the value 202106L in c++2b"
144161
# endif
145162

163+
# ifndef __cpp_lib_ranges_as_rvalue
164+
# error "__cpp_lib_ranges_as_rvalue should be defined in c++2b"
165+
# endif
166+
# if __cpp_lib_ranges_as_rvalue != 202207L
167+
# error "__cpp_lib_ranges_as_rvalue should have the value 202207L in c++2b"
168+
# endif
169+
146170
# if !defined(_LIBCPP_VERSION)
147171
# ifndef __cpp_lib_ranges_chunk
148172
# error "__cpp_lib_ranges_chunk should be defined in c++2b"

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

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@
128128
__cpp_lib_polymorphic_allocator 201902L [C++20]
129129
__cpp_lib_quoted_string_io 201304L [C++14]
130130
__cpp_lib_ranges 202106L [C++20]
131+
__cpp_lib_ranges_as_rvalue 202207L [C++2b]
131132
__cpp_lib_ranges_chunk 202202L [C++2b]
132133
__cpp_lib_ranges_chunk_by 202202L [C++2b]
133134
__cpp_lib_ranges_iota 202202L [C++2b]
@@ -621,6 +622,10 @@
621622
# error "__cpp_lib_ranges should not be defined before c++20"
622623
# endif
623624

625+
# ifdef __cpp_lib_ranges_as_rvalue
626+
# error "__cpp_lib_ranges_as_rvalue should not be defined before c++2b"
627+
# endif
628+
624629
# ifdef __cpp_lib_ranges_chunk
625630
# error "__cpp_lib_ranges_chunk should not be defined before c++2b"
626631
# endif
@@ -1295,6 +1300,10 @@
12951300
# error "__cpp_lib_ranges should not be defined before c++20"
12961301
# endif
12971302

1303+
# ifdef __cpp_lib_ranges_as_rvalue
1304+
# error "__cpp_lib_ranges_as_rvalue should not be defined before c++2b"
1305+
# endif
1306+
12981307
# ifdef __cpp_lib_ranges_chunk
12991308
# error "__cpp_lib_ranges_chunk should not be defined before c++2b"
13001309
# endif
@@ -2134,6 +2143,10 @@
21342143
# error "__cpp_lib_ranges should not be defined before c++20"
21352144
# endif
21362145

2146+
# ifdef __cpp_lib_ranges_as_rvalue
2147+
# error "__cpp_lib_ranges_as_rvalue should not be defined before c++2b"
2148+
# endif
2149+
21372150
# ifdef __cpp_lib_ranges_chunk
21382151
# error "__cpp_lib_ranges_chunk should not be defined before c++2b"
21392152
# endif
@@ -3240,6 +3253,10 @@
32403253
# error "__cpp_lib_ranges should have the value 202106L in c++20"
32413254
# endif
32423255

3256+
# ifdef __cpp_lib_ranges_as_rvalue
3257+
# error "__cpp_lib_ranges_as_rvalue should not be defined before c++2b"
3258+
# endif
3259+
32433260
# ifdef __cpp_lib_ranges_chunk
32443261
# error "__cpp_lib_ranges_chunk should not be defined before c++2b"
32453262
# endif
@@ -4505,6 +4522,13 @@
45054522
# error "__cpp_lib_ranges should have the value 202106L in c++2b"
45064523
# endif
45074524

4525+
# ifndef __cpp_lib_ranges_as_rvalue
4526+
# error "__cpp_lib_ranges_as_rvalue should be defined in c++2b"
4527+
# endif
4528+
# if __cpp_lib_ranges_as_rvalue != 202207L
4529+
# error "__cpp_lib_ranges_as_rvalue should have the value 202207L in c++2b"
4530+
# endif
4531+
45084532
# if !defined(_LIBCPP_VERSION)
45094533
# ifndef __cpp_lib_ranges_chunk
45104534
# error "__cpp_lib_ranges_chunk should be defined in c++2b"

libcxx/utils/generate_feature_test_macro_components.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -536,6 +536,10 @@ def add_version_header(tc):
536536
"name": "__cpp_lib_ranges",
537537
"values": { "c++20": 202106 },
538538
"headers": ["algorithm", "functional", "iterator", "memory", "ranges"],
539+
}, {
540+
"name": "__cpp_lib_ranges_as_rvalue",
541+
"values": { "c++2b": 202207 },
542+
"headers": ["ranges"],
539543
}, {
540544
"name": "__cpp_lib_ranges_chunk",
541545
"values": { "c++2b": 202202 },

0 commit comments

Comments
 (0)