diff --git a/libcxx/docs/FeatureTestMacroTable.rst b/libcxx/docs/FeatureTestMacroTable.rst --- a/libcxx/docs/FeatureTestMacroTable.rst +++ b/libcxx/docs/FeatureTestMacroTable.rst @@ -332,6 +332,8 @@ ------------------------------------------------- ----------------- ``__cpp_lib_out_ptr`` *unimplemented* ------------------------------------------------- ----------------- + ``__cpp_lib_ranges_as_rvalue`` ``202207L`` + ------------------------------------------------- ----------------- ``__cpp_lib_ranges_chunk`` *unimplemented* ------------------------------------------------- ----------------- ``__cpp_lib_ranges_chunk_by`` *unimplemented* diff --git a/libcxx/include/version b/libcxx/include/version --- a/libcxx/include/version +++ b/libcxx/include/version @@ -139,6 +139,7 @@ __cpp_lib_quoted_string_io 201304L __cpp_lib_ranges 202106L +__cpp_lib_ranges_as_rvalue 202207L __cpp_lib_ranges_chunk 202202L __cpp_lib_ranges_chunk_by 202202L __cpp_lib_ranges_iota 202202L @@ -401,6 +402,7 @@ # 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 diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/ranges.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/ranges.version.compile.pass.cpp --- a/libcxx/test/std/language.support/support.limits/support.limits.general/ranges.version.compile.pass.cpp +++ b/libcxx/test/std/language.support/support.limits/support.limits.general/ranges.version.compile.pass.cpp @@ -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] @@ -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 @@ -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 @@ -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 @@ -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 @@ -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" diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/version.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/version.version.compile.pass.cpp --- a/libcxx/test/std/language.support/support.limits/support.limits.general/version.version.compile.pass.cpp +++ b/libcxx/test/std/language.support/support.limits/support.limits.general/version.version.compile.pass.cpp @@ -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] @@ -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 @@ -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 @@ -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 @@ -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 @@ -4493,6 +4510,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" diff --git a/libcxx/utils/generate_feature_test_macro_components.py b/libcxx/utils/generate_feature_test_macro_components.py --- a/libcxx/utils/generate_feature_test_macro_components.py +++ b/libcxx/utils/generate_feature_test_macro_components.py @@ -534,6 +534,10 @@ "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 },