diff --git a/libcxx/include/__availability b/libcxx/include/__availability --- a/libcxx/include/__availability +++ b/libcxx/include/__availability @@ -138,6 +138,13 @@ // # define _LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_latch // # define _LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_semaphore + // This controls the availability of the C++20 format library. + // The library is in development and not ABI stable yet. Currently + // P2216 is aiming to be retroactively accepted in C++20. This paper + // contains ABI breaking changes. +# define _LIBCPP_AVAILABILITY_FORMAT +// # define _LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_format + #elif defined(__APPLE__) # define _LIBCPP_AVAILABILITY_SHARED_MUTEX \ @@ -223,6 +230,13 @@ # define _LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_latch # define _LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_semaphore + // This controls the availability of the C++20 format library. + // The library is in development and not ABI stable yet. Currently + // P2216 is aiming to be retroactively accepted in C++20. This paper + // contains ABI breaking changes. +# define _LIBCPP_AVAILABILITY_FORMAT \ + __attribute__((unavailable)) +# define _LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_format #else // ...New vendors can add availability markup here... diff --git a/libcxx/include/__format/format_parse_context.h b/libcxx/include/__format/format_parse_context.h --- a/libcxx/include/__format/format_parse_context.h +++ b/libcxx/include/__format/format_parse_context.h @@ -33,7 +33,7 @@ !defined(_LIBCPP_HAS_NO_BUILTIN_IS_CONSTANT_EVALUATED) template -class _LIBCPP_TEMPLATE_VIS basic_format_parse_context { +class _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT basic_format_parse_context { public: using char_type = _CharT; using const_iterator = typename basic_string_view<_CharT>::const_iterator; diff --git a/libcxx/include/version b/libcxx/include/version --- a/libcxx/include/version +++ b/libcxx/include/version @@ -319,7 +319,9 @@ # define __cpp_lib_erase_if 202002L # undef __cpp_lib_execution // # define __cpp_lib_execution 201902L -// # define __cpp_lib_format 201907L +# if !defined(_LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_format) +// # define __cpp_lib_format 201907L +# endif # define __cpp_lib_generic_unordered_lookup 201811L # define __cpp_lib_int_pow2 202002L # if !defined(_LIBCPP_HAS_NO_CONCEPTS) 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 @@ -300,6 +300,8 @@ "name": "__cpp_lib_format", "values": { "c++20": 201907 }, "headers": ["format"], + "test_suite_guard": "!defined(_LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_format)", + "libcxx_guard": "!defined(_LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_format)", "unimplemented": True, }, { "name": "__cpp_lib_gcd_lcm",