forked from OSchip/llvm-project
[libc++][format] Adds availability macros for std::format.
This prevents std::format to be available until there's an ABI stable version. (This only impacts the Apple platform.) Depends on D102703 Reviewed By: ldionne, #libc Differential Revision: https://reviews.llvm.org/D102705
This commit is contained in:
parent
74a89cba8c
commit
963495f0d4
|
@ -138,6 +138,13 @@
|
||||||
// # define _LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_latch
|
// # define _LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_latch
|
||||||
// # define _LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_semaphore
|
// # 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__)
|
#elif defined(__APPLE__)
|
||||||
|
|
||||||
# define _LIBCPP_AVAILABILITY_SHARED_MUTEX \
|
# define _LIBCPP_AVAILABILITY_SHARED_MUTEX \
|
||||||
|
@ -223,6 +230,13 @@
|
||||||
# define _LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_latch
|
# define _LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_latch
|
||||||
# define _LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_semaphore
|
# 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
|
#else
|
||||||
|
|
||||||
// ...New vendors can add availability markup here...
|
// ...New vendors can add availability markup here...
|
||||||
|
|
|
@ -33,7 +33,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
|
||||||
!defined(_LIBCPP_HAS_NO_BUILTIN_IS_CONSTANT_EVALUATED)
|
!defined(_LIBCPP_HAS_NO_BUILTIN_IS_CONSTANT_EVALUATED)
|
||||||
|
|
||||||
template <class _CharT>
|
template <class _CharT>
|
||||||
class _LIBCPP_TEMPLATE_VIS basic_format_parse_context {
|
class _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT basic_format_parse_context {
|
||||||
public:
|
public:
|
||||||
using char_type = _CharT;
|
using char_type = _CharT;
|
||||||
using const_iterator = typename basic_string_view<_CharT>::const_iterator;
|
using const_iterator = typename basic_string_view<_CharT>::const_iterator;
|
||||||
|
|
|
@ -319,7 +319,9 @@ __cpp_lib_void_t 201411L <type_traits>
|
||||||
# define __cpp_lib_erase_if 202002L
|
# define __cpp_lib_erase_if 202002L
|
||||||
# undef __cpp_lib_execution
|
# undef __cpp_lib_execution
|
||||||
// # define __cpp_lib_execution 201902L
|
// # 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_generic_unordered_lookup 201811L
|
||||||
# define __cpp_lib_int_pow2 202002L
|
# define __cpp_lib_int_pow2 202002L
|
||||||
# if !defined(_LIBCPP_HAS_NO_CONCEPTS)
|
# if !defined(_LIBCPP_HAS_NO_CONCEPTS)
|
||||||
|
|
|
@ -300,6 +300,8 @@ feature_test_macros = [ add_version_header(x) for x in [
|
||||||
"name": "__cpp_lib_format",
|
"name": "__cpp_lib_format",
|
||||||
"values": { "c++20": 201907 },
|
"values": { "c++20": 201907 },
|
||||||
"headers": ["format"],
|
"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,
|
"unimplemented": True,
|
||||||
}, {
|
}, {
|
||||||
"name": "__cpp_lib_gcd_lcm",
|
"name": "__cpp_lib_gcd_lcm",
|
||||||
|
|
Loading…
Reference in New Issue