[libcxx-commits] [PATCH] D137911: [libc++][format] Makes format_context copyable.

Mark de Wever via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Sun Nov 13 09:53:42 PST 2022


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

This was a bug discovered by @jwakely.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D137911

Files:
  libcxx/include/__format/format_context.h
  libcxx/test/std/utilities/format/format.formatter/format.context/format.context/ctor.pass.cpp


Index: libcxx/test/std/utilities/format/format.formatter/format.context/format.context/ctor.pass.cpp
===================================================================
--- libcxx/test/std/utilities/format/format.formatter/format.context/format.context/ctor.pass.cpp
+++ libcxx/test/std/utilities/format/format.formatter/format.context/format.context/ctor.pass.cpp
@@ -34,17 +34,6 @@
 
 template <class OutIt, class CharT>
 void test() {
-  static_assert(
-      !std::is_copy_constructible_v<std::basic_format_context<OutIt, CharT>>);
-  static_assert(
-      !std::is_copy_assignable_v<std::basic_format_context<OutIt, CharT>>);
-  // The move operations are implicitly deleted due to the
-  // deleted copy operations.
-  static_assert(
-      !std::is_move_constructible_v<std::basic_format_context<OutIt, CharT>>);
-  static_assert(
-      !std::is_move_assignable_v<std::basic_format_context<OutIt, CharT>>);
-
   std::basic_string<CharT> string = MAKE_STRING(CharT, "string");
   // The type of the object is an exposition only type. The temporary is needed
   // to extend the lifetype of the object since args stores a pointer to the
Index: libcxx/include/__format/format_context.h
===================================================================
--- libcxx/include/__format/format_context.h
+++ libcxx/include/__format/format_context.h
@@ -85,9 +85,6 @@
   template <class _Tp>
   using formatter_type = formatter<_Tp, _CharT>;
 
-  basic_format_context(const basic_format_context&) = delete;
-  basic_format_context& operator=(const basic_format_context&) = delete;
-
   _LIBCPP_HIDE_FROM_ABI basic_format_arg<basic_format_context>
   arg(size_t __id) const noexcept {
     return __args_.get(__id);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D137911.475004.patch
Type: text/x-patch
Size: 1714 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20221113/69518b48/attachment.bin>


More information about the libcxx-commits mailing list