[libcxx-commits] [PATCH] D102705: Adds availability macros for std::format.

Mark de Wever via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Tue May 18 11:12:16 PDT 2021


Mordante created this revision.
Mordante added a reviewer: ldionne.
Mordante requested review of this revision.
Herald added a project: libc++.
Herald added a subscriber: libcxx-commits.
Herald added a reviewer: libc++.

This prevents std::format to be available until there's an ABI stable
version. (This only impacts the Apple platform.)

Depends on 102703


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D102705

Files:
  libcxx/include/__availability
  libcxx/include/__format/format_parse_context.h


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,12 @@
 // #   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
+
 #elif defined(__APPLE__)
 
 #   define _LIBCPP_AVAILABILITY_SHARED_MUTEX                                    \
@@ -223,6 +229,12 @@
 #   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))
 #else
 
 // ...New vendors can add availability markup here...


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D102705.346221.patch
Type: text/x-patch
Size: 1908 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20210518/8af9a9e7/attachment.bin>


More information about the libcxx-commits mailing list