Skip to content

Commit

Permalink
[libc++] Add FTM for views::as_rvalue
Browse files Browse the repository at this point in the history
`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)
  • Loading branch information
philnik777 authored and tru committed Feb 28, 2023
1 parent abf3297 commit 54dee0b
Show file tree
Hide file tree
Showing 5 changed files with 56 additions and 0 deletions.
2 changes: 2 additions & 0 deletions libcxx/docs/FeatureTestMacroTable.rst
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,8 @@ Status
------------------------------------------------- -----------------
``__cpp_lib_out_ptr`` *unimplemented*
------------------------------------------------- -----------------
``__cpp_lib_ranges_as_rvalue`` ``202207L``
------------------------------------------------- -----------------
``__cpp_lib_ranges_chunk`` *unimplemented*
------------------------------------------------- -----------------
``__cpp_lib_ranges_chunk_by`` *unimplemented*
Expand Down
2 changes: 2 additions & 0 deletions libcxx/include/version
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ __cpp_lib_polymorphic_allocator 201902L <memory_resource
__cpp_lib_quoted_string_io 201304L <iomanip>
__cpp_lib_ranges 202106L <algorithm> <functional> <iterator>
<memory> <ranges>
__cpp_lib_ranges_as_rvalue 202207L <ranges>
__cpp_lib_ranges_chunk 202202L <ranges>
__cpp_lib_ranges_chunk_by 202202L <ranges>
__cpp_lib_ranges_iota 202202L <numeric>
Expand Down Expand Up @@ -401,6 +402,7 @@ __cpp_lib_void_t 201411L <type_traits>
# undef __cpp_lib_optional
# define __cpp_lib_optional 202110L
// # define __cpp_lib_out_ptr 202106L
# define __cpp_lib_ranges_as_rvalue 202207L
// # define __cpp_lib_ranges_chunk 202202L
// # define __cpp_lib_ranges_chunk_by 202202L
// # define __cpp_lib_ranges_iota 202202L
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

/* Constant Value
__cpp_lib_ranges 202106L [C++20]
__cpp_lib_ranges_as_rvalue 202207L [C++2b]
__cpp_lib_ranges_chunk 202202L [C++2b]
__cpp_lib_ranges_chunk_by 202202L [C++2b]
__cpp_lib_ranges_join_with 202202L [C++2b]
Expand All @@ -33,6 +34,10 @@
# error "__cpp_lib_ranges should not be defined before c++20"
# endif

# ifdef __cpp_lib_ranges_as_rvalue
# error "__cpp_lib_ranges_as_rvalue should not be defined before c++2b"
# endif

# ifdef __cpp_lib_ranges_chunk
# error "__cpp_lib_ranges_chunk should not be defined before c++2b"
# endif
Expand All @@ -59,6 +64,10 @@
# error "__cpp_lib_ranges should not be defined before c++20"
# endif

# ifdef __cpp_lib_ranges_as_rvalue
# error "__cpp_lib_ranges_as_rvalue should not be defined before c++2b"
# endif

# ifdef __cpp_lib_ranges_chunk
# error "__cpp_lib_ranges_chunk should not be defined before c++2b"
# endif
Expand All @@ -85,6 +94,10 @@
# error "__cpp_lib_ranges should not be defined before c++20"
# endif

# ifdef __cpp_lib_ranges_as_rvalue
# error "__cpp_lib_ranges_as_rvalue should not be defined before c++2b"
# endif

# ifdef __cpp_lib_ranges_chunk
# error "__cpp_lib_ranges_chunk should not be defined before c++2b"
# endif
Expand Down Expand Up @@ -114,6 +127,10 @@
# error "__cpp_lib_ranges should have the value 202106L in c++20"
# endif

# ifdef __cpp_lib_ranges_as_rvalue
# error "__cpp_lib_ranges_as_rvalue should not be defined before c++2b"
# endif

# ifdef __cpp_lib_ranges_chunk
# error "__cpp_lib_ranges_chunk should not be defined before c++2b"
# endif
Expand Down Expand Up @@ -143,6 +160,13 @@
# error "__cpp_lib_ranges should have the value 202106L in c++2b"
# endif

# ifndef __cpp_lib_ranges_as_rvalue
# error "__cpp_lib_ranges_as_rvalue should be defined in c++2b"
# endif
# if __cpp_lib_ranges_as_rvalue != 202207L
# error "__cpp_lib_ranges_as_rvalue should have the value 202207L in c++2b"
# endif

# if !defined(_LIBCPP_VERSION)
# ifndef __cpp_lib_ranges_chunk
# error "__cpp_lib_ranges_chunk should be defined in c++2b"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@
__cpp_lib_polymorphic_allocator 201902L [C++20]
__cpp_lib_quoted_string_io 201304L [C++14]
__cpp_lib_ranges 202106L [C++20]
__cpp_lib_ranges_as_rvalue 202207L [C++2b]
__cpp_lib_ranges_chunk 202202L [C++2b]
__cpp_lib_ranges_chunk_by 202202L [C++2b]
__cpp_lib_ranges_iota 202202L [C++2b]
Expand Down Expand Up @@ -621,6 +622,10 @@
# error "__cpp_lib_ranges should not be defined before c++20"
# endif

# ifdef __cpp_lib_ranges_as_rvalue
# error "__cpp_lib_ranges_as_rvalue should not be defined before c++2b"
# endif

# ifdef __cpp_lib_ranges_chunk
# error "__cpp_lib_ranges_chunk should not be defined before c++2b"
# endif
Expand Down Expand Up @@ -1295,6 +1300,10 @@
# error "__cpp_lib_ranges should not be defined before c++20"
# endif

# ifdef __cpp_lib_ranges_as_rvalue
# error "__cpp_lib_ranges_as_rvalue should not be defined before c++2b"
# endif

# ifdef __cpp_lib_ranges_chunk
# error "__cpp_lib_ranges_chunk should not be defined before c++2b"
# endif
Expand Down Expand Up @@ -2134,6 +2143,10 @@
# error "__cpp_lib_ranges should not be defined before c++20"
# endif

# ifdef __cpp_lib_ranges_as_rvalue
# error "__cpp_lib_ranges_as_rvalue should not be defined before c++2b"
# endif

# ifdef __cpp_lib_ranges_chunk
# error "__cpp_lib_ranges_chunk should not be defined before c++2b"
# endif
Expand Down Expand Up @@ -3240,6 +3253,10 @@
# error "__cpp_lib_ranges should have the value 202106L in c++20"
# endif

# ifdef __cpp_lib_ranges_as_rvalue
# error "__cpp_lib_ranges_as_rvalue should not be defined before c++2b"
# endif

# ifdef __cpp_lib_ranges_chunk
# error "__cpp_lib_ranges_chunk should not be defined before c++2b"
# endif
Expand Down Expand Up @@ -4505,6 +4522,13 @@
# error "__cpp_lib_ranges should have the value 202106L in c++2b"
# endif

# ifndef __cpp_lib_ranges_as_rvalue
# error "__cpp_lib_ranges_as_rvalue should be defined in c++2b"
# endif
# if __cpp_lib_ranges_as_rvalue != 202207L
# error "__cpp_lib_ranges_as_rvalue should have the value 202207L in c++2b"
# endif

# if !defined(_LIBCPP_VERSION)
# ifndef __cpp_lib_ranges_chunk
# error "__cpp_lib_ranges_chunk should be defined in c++2b"
Expand Down
4 changes: 4 additions & 0 deletions libcxx/utils/generate_feature_test_macro_components.py
Original file line number Diff line number Diff line change
Expand Up @@ -536,6 +536,10 @@ def add_version_header(tc):
"name": "__cpp_lib_ranges",
"values": { "c++20": 202106 },
"headers": ["algorithm", "functional", "iterator", "memory", "ranges"],
}, {
"name": "__cpp_lib_ranges_as_rvalue",
"values": { "c++2b": 202207 },
"headers": ["ranges"],
}, {
"name": "__cpp_lib_ranges_chunk",
"values": { "c++2b": 202202 },
Expand Down

0 comments on commit 54dee0b

Please sign in to comment.