Index: libcxx/docs/FeatureTestMacroTable.rst =================================================================== --- libcxx/docs/FeatureTestMacroTable.rst +++ libcxx/docs/FeatureTestMacroTable.rst @@ -224,6 +224,8 @@ ------------------------------------------------- ----------------- ``__cpp_lib_span`` ``202002L`` ------------------------------------------------- ----------------- + ``__cpp_lib_starts_ends_with`` ``201711L`` + ------------------------------------------------- ----------------- ``__cpp_lib_three_way_comparison`` *unimplemented* ------------------------------------------------- ----------------- ``__cpp_lib_to_array`` ``201907L`` Index: libcxx/include/version =================================================================== --- libcxx/include/version +++ libcxx/include/version @@ -110,6 +110,7 @@ __cpp_lib_shared_ptr_weak_type 201606L __cpp_lib_shared_timed_mutex 201402L __cpp_lib_span 202002L +__cpp_lib_starts_ends_with 201711L __cpp_lib_string_udls 201304L __cpp_lib_string_view 201606L __cpp_lib_three_way_comparison 201711L @@ -274,6 +275,7 @@ # endif // # define __cpp_lib_ranges 201811L # define __cpp_lib_span 202002L +# define __cpp_lib_starts_ends_with 201711L // # define __cpp_lib_three_way_comparison 201711L # define __cpp_lib_to_array 201907L #endif Index: libcxx/test/std/language.support/support.limits/support.limits.general/string.version.pass.cpp =================================================================== --- libcxx/test/std/language.support/support.limits/support.limits.general/string.version.pass.cpp +++ libcxx/test/std/language.support/support.limits/support.limits.general/string.version.pass.cpp @@ -18,6 +18,7 @@ __cpp_lib_char8_t 201811L [C++2a] __cpp_lib_erase_if 202002L [C++2a] __cpp_lib_nonmember_container_access 201411L [C++17] + __cpp_lib_starts_ends_with 201711L [C++2a] __cpp_lib_string_udls 201304L [C++14] __cpp_lib_string_view 201606L [C++17] */ @@ -43,6 +44,10 @@ # error "__cpp_lib_nonmember_container_access should not be defined before c++17" # endif +# ifdef __cpp_lib_starts_ends_with +# error "__cpp_lib_starts_ends_with should not be defined before c++2a" +# endif + # ifdef __cpp_lib_string_udls # error "__cpp_lib_string_udls should not be defined before c++14" # endif @@ -69,6 +74,10 @@ # error "__cpp_lib_nonmember_container_access should not be defined before c++17" # endif +# ifdef __cpp_lib_starts_ends_with +# error "__cpp_lib_starts_ends_with should not be defined before c++2a" +# endif + # ifndef __cpp_lib_string_udls # error "__cpp_lib_string_udls should be defined in c++14" # endif @@ -104,6 +113,10 @@ # error "__cpp_lib_nonmember_container_access should have the value 201411L in c++17" # endif +# ifdef __cpp_lib_starts_ends_with +# error "__cpp_lib_starts_ends_with should not be defined before c++2a" +# endif + # ifndef __cpp_lib_string_udls # error "__cpp_lib_string_udls should be defined in c++17" # endif @@ -154,6 +167,13 @@ # error "__cpp_lib_nonmember_container_access should have the value 201411L in c++2a" # endif +# ifndef __cpp_lib_starts_ends_with +# error "__cpp_lib_starts_ends_with should be defined in c++2a" +# endif +# if __cpp_lib_starts_ends_with != 201711L +# error "__cpp_lib_starts_ends_with should have the value 201711L in c++2a" +# endif + # ifndef __cpp_lib_string_udls # error "__cpp_lib_string_udls should be defined in c++2a" # endif Index: libcxx/test/std/language.support/support.limits/support.limits.general/string_view.version.pass.cpp =================================================================== --- libcxx/test/std/language.support/support.limits/support.limits.general/string_view.version.pass.cpp +++ libcxx/test/std/language.support/support.limits/support.limits.general/string_view.version.pass.cpp @@ -13,9 +13,10 @@ // Test the feature test macros defined by -/* Constant Value - __cpp_lib_char8_t 201811L [C++2a] - __cpp_lib_string_view 201606L [C++17] +/* Constant Value + __cpp_lib_char8_t 201811L [C++2a] + __cpp_lib_starts_ends_with 201711L [C++2a] + __cpp_lib_string_view 201606L [C++17] */ #include @@ -27,6 +28,10 @@ # error "__cpp_lib_char8_t should not be defined before c++2a" # endif +# ifdef __cpp_lib_starts_ends_with +# error "__cpp_lib_starts_ends_with should not be defined before c++2a" +# endif + # ifdef __cpp_lib_string_view # error "__cpp_lib_string_view should not be defined before c++17" # endif @@ -37,6 +42,10 @@ # error "__cpp_lib_char8_t should not be defined before c++2a" # endif +# ifdef __cpp_lib_starts_ends_with +# error "__cpp_lib_starts_ends_with should not be defined before c++2a" +# endif + # ifdef __cpp_lib_string_view # error "__cpp_lib_string_view should not be defined before c++17" # endif @@ -47,6 +56,10 @@ # error "__cpp_lib_char8_t should not be defined before c++2a" # endif +# ifdef __cpp_lib_starts_ends_with +# error "__cpp_lib_starts_ends_with should not be defined before c++2a" +# endif + # ifndef __cpp_lib_string_view # error "__cpp_lib_string_view should be defined in c++17" # endif @@ -69,6 +82,13 @@ # endif # endif +# ifndef __cpp_lib_starts_ends_with +# error "__cpp_lib_starts_ends_with should be defined in c++2a" +# endif +# if __cpp_lib_starts_ends_with != 201711L +# error "__cpp_lib_starts_ends_with should have the value 201711L in c++2a" +# endif + # ifndef __cpp_lib_string_view # error "__cpp_lib_string_view should be defined in c++2a" # endif Index: libcxx/test/std/language.support/support.limits/support.limits.general/version.version.pass.cpp =================================================================== --- libcxx/test/std/language.support/support.limits/support.limits.general/version.version.pass.cpp +++ libcxx/test/std/language.support/support.limits/support.limits.general/version.version.pass.cpp @@ -98,6 +98,7 @@ __cpp_lib_shared_ptr_weak_type 201606L [C++17] __cpp_lib_shared_timed_mutex 201402L [C++14] __cpp_lib_span 202002L [C++2a] + __cpp_lib_starts_ends_with 201711L [C++2a] __cpp_lib_string_udls 201304L [C++14] __cpp_lib_string_view 201606L [C++17] __cpp_lib_three_way_comparison 201711L [C++2a] @@ -452,6 +453,10 @@ # error "__cpp_lib_span should not be defined before c++2a" # endif +# ifdef __cpp_lib_starts_ends_with +# error "__cpp_lib_starts_ends_with should not be defined before c++2a" +# endif + # ifdef __cpp_lib_string_udls # error "__cpp_lib_string_udls should not be defined before c++14" # endif @@ -893,6 +898,10 @@ # error "__cpp_lib_span should not be defined before c++2a" # endif +# ifdef __cpp_lib_starts_ends_with +# error "__cpp_lib_starts_ends_with should not be defined before c++2a" +# endif + # ifndef __cpp_lib_string_udls # error "__cpp_lib_string_udls should be defined in c++14" # endif @@ -1538,6 +1547,10 @@ # error "__cpp_lib_span should not be defined before c++2a" # endif +# ifdef __cpp_lib_starts_ends_with +# error "__cpp_lib_starts_ends_with should not be defined before c++2a" +# endif + # ifndef __cpp_lib_string_udls # error "__cpp_lib_string_udls should be defined in c++17" # endif @@ -2387,6 +2400,13 @@ # error "__cpp_lib_span should have the value 202002L in c++2a" # endif +# ifndef __cpp_lib_starts_ends_with +# error "__cpp_lib_starts_ends_with should be defined in c++2a" +# endif +# if __cpp_lib_starts_ends_with != 201711L +# error "__cpp_lib_starts_ends_with should have the value 201711L in c++2a" +# endif + # ifndef __cpp_lib_string_udls # error "__cpp_lib_string_udls should be defined in c++2a" # endif Index: libcxx/utils/generate_feature_test_macro_components.py =================================================================== --- libcxx/utils/generate_feature_test_macro_components.py +++ libcxx/utils/generate_feature_test_macro_components.py @@ -485,6 +485,10 @@ "name": "__cpp_lib_constexpr_dynamic_alloc", "values": { "c++2a": int(201907) }, "headers": ["memory"] + }, { + "name": "__cpp_lib_starts_ends_with", + "values": { "c++2a": int(201711) }, + "headers": ["string", "string_view"] }, ]], key=lambda tc: tc["name"])