[libcxx-commits] [PATCH] D102705: Adds availability macros for std::format.
Mark de Wever via Phabricator via libcxx-commits
libcxx-commits at lists.llvm.org
Thu May 20 09:37:17 PDT 2021
Mordante updated this revision to Diff 346766.
Mordante marked an inline comment as done.
Mordante added a comment.
Herald added a subscriber: arichardson.
Properly disable std::format when the availablity macro requires it.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D102705/new/
https://reviews.llvm.org/D102705
Files:
libcxx/include/__availability
libcxx/include/__format/format_parse_context.h
libcxx/include/version
libcxx/utils/generate_feature_test_macro_components.py
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
@@ -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",
Index: libcxx/include/version
===================================================================
--- libcxx/include/version
+++ 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)
Index: libcxx/include/__format/format_parse_context.h
===================================================================
--- libcxx/include/__format/format_parse_context.h
+++ libcxx/include/__format/format_parse_context.h
@@ -33,7 +33,7 @@
!defined(_LIBCPP_HAS_NO_BUILTIN_IS_CONSTANT_EVALUATED)
template <class _CharT>
-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;
Index: libcxx/include/__availability
===================================================================
--- libcxx/include/__availability
+++ 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...
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D102705.346766.patch
Type: text/x-patch
Size: 3358 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20210520/f5e17890/attachment.bin>
More information about the libcxx-commits
mailing list