[libcxx-commits] [PATCH] D150073: [libc++][format] Removes format sources.

Mark de Wever via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Tue May 16 11:32:07 PDT 2023


This revision was automatically updated to reflect the committed changes.
Closed by commit rGdc95245e69a1: [libc++][format] Removes format sources. (authored by Mordante).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D150073/new/

https://reviews.llvm.org/D150073

Files:
  libcxx/CMakeLists.txt
  libcxx/include/__format/format_error.h
  libcxx/src/CMakeLists.txt
  libcxx/src/format.cpp


Index: libcxx/src/format.cpp
===================================================================
--- libcxx/src/format.cpp
+++ /dev/null
@@ -1,17 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-#include <format>
-
-_LIBCPP_BEGIN_NAMESPACE_STD
-
-#ifndef _LIBCPP_INLINE_FORMAT_ERROR_DTOR
-format_error::~format_error() noexcept = default;
-#endif
-
-_LIBCPP_END_NAMESPACE_STD
Index: libcxx/src/CMakeLists.txt
===================================================================
--- libcxx/src/CMakeLists.txt
+++ libcxx/src/CMakeLists.txt
@@ -311,7 +311,6 @@
 
 set(LIBCXX_EXPERIMENTAL_SOURCES
   experimental/memory_resource.cpp
-  format.cpp
   )
 
 add_library(cxx_experimental STATIC ${LIBCXX_EXPERIMENTAL_SOURCES})
Index: libcxx/include/__format/format_error.h
===================================================================
--- libcxx/include/__format/format_error.h
+++ libcxx/include/__format/format_error.h
@@ -22,21 +22,18 @@
 
 #if _LIBCPP_STD_VER >= 20
 
+_LIBCPP_DIAGNOSTIC_PUSH
+_LIBCPP_CLANG_DIAGNOSTIC_IGNORED("-Wweak-vtables")
 class _LIBCPP_EXCEPTION_ABI format_error : public runtime_error {
 public:
   _LIBCPP_HIDE_FROM_ABI explicit format_error(const string& __s)
       : runtime_error(__s) {}
   _LIBCPP_HIDE_FROM_ABI explicit format_error(const char* __s)
       : runtime_error(__s) {}
-  // TODO FMT Remove when format is no longer experimental.
-  // Avoids linker errors when building the Clang-cl Windows DLL which doesn't
-  // support the experimental library.
-#  ifndef _LIBCPP_INLINE_FORMAT_ERROR_DTOR
-  ~format_error() noexcept override;
-#  else
-  ~format_error() noexcept  override {}
-#  endif
+  _LIBCPP_HIDE_FROM_ABI_VIRTUAL
+  ~format_error() noexcept override = default;
 };
+_LIBCPP_DIAGNOSTIC_POP
 
 _LIBCPP_NORETURN inline _LIBCPP_HIDE_FROM_ABI void
 __throw_format_error(const char* __s) {
Index: libcxx/CMakeLists.txt
===================================================================
--- libcxx/CMakeLists.txt
+++ libcxx/CMakeLists.txt
@@ -763,14 +763,6 @@
                                  # Use the ISO conforming behaviour for conversion
                                  # in printf, scanf.
                                  _CRT_STDIO_ISO_WIDE_SPECIFIERS)
-    # Clang-cl shared builds don't support the experimental library.
-    # To avoid linker errors the format_error destructor is inlined for the
-    # dylib. Users can never use format in this mode.
-    # TODO FMT Remove when format becomes mainline.
-    if (LIBCXX_ENABLE_SHARED)
-      target_compile_definitions(${target} PRIVATE
-                                 _LIBCPP_INLINE_FORMAT_ERROR_DTOR)
-    endif()
   endif()
 endfunction()
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D150073.522725.patch
Type: text/x-patch
Size: 3000 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20230516/29a59086/attachment.bin>


More information about the libcxx-commits mailing list