[libcxx-commits] [PATCH] D144275: [libc++][format] Addresses LWG3810.

Mark de Wever via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Fri Feb 17 12:08:39 PST 2023


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

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D144275

Files:
  libcxx/docs/Status/Cxx2bIssues.csv
  libcxx/include/__format/format_args.h
  libcxx/test/std/utilities/format/format.arguments/format.args/ctad.compile.pass.cpp


Index: libcxx/test/std/utilities/format/format.arguments/format.args/ctad.compile.pass.cpp
===================================================================
--- /dev/null
+++ libcxx/test/std/utilities/format/format.arguments/format.args/ctad.compile.pass.cpp
@@ -0,0 +1,31 @@
+//===----------------------------------------------------------------------===//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++03, c++11, c++14, c++17
+// UNSUPPORTED: libcpp-has-no-incomplete-format
+
+// <format>
+
+// template<class Context, class... Args>
+//   basic_format_args(format-arg-store<Context, Args...>) -> basic_format_args<Context>;
+
+#include <concepts>
+#include <format>
+
+#include "test_macros.h"
+
+void test() {
+  // Note the Standard way to create a format-arg-store is by using make_format_args.
+  static_assert(std::same_as<decltype(std::basic_format_args(std::make_format_args(42))),
+                             std::basic_format_args<std::format_context>>);
+
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
+  static_assert(std::same_as<decltype(std::basic_format_args(std::make_wformat_args(42))),
+                             std::basic_format_args<std::wformat_context>>);
+
+#endif
+}
Index: libcxx/include/__format/format_args.h
===================================================================
--- libcxx/include/__format/format_args.h
+++ libcxx/include/__format/format_args.h
@@ -71,7 +71,9 @@
     const basic_format_arg<_Context>* __args_;
   };
 };
-_LIBCPP_CTAD_SUPPORTED_FOR_TYPE(basic_format_args);
+
+template <class _Context, class... _Args>
+basic_format_args(__format_arg_store<_Context, _Args...>) -> basic_format_args<_Context>;
 
 #endif //_LIBCPP_STD_VER >= 20
 
Index: libcxx/docs/Status/Cxx2bIssues.csv
===================================================================
--- libcxx/docs/Status/Cxx2bIssues.csv
+++ libcxx/docs/Status/Cxx2bIssues.csv
@@ -286,7 +286,7 @@
 "`3772 <https://wg21.link/LWG3772>`__","``repeat_view``'s ``piecewise`` constructor is missing Postconditions","February 2023","","","|ranges|"
 "`3786 <https://wg21.link/LWG3786>`__","Flat maps' deduction guide needs to default ``Allocator`` to be useful","February 2023","","",""
 "`3803 <https://wg21.link/LWG3803>`__","``flat_foo`` constructors taking ``KeyContainer`` lack ``KeyCompare`` parameter","February 2023","","",""
-"`3810 <https://wg21.link/LWG3810>`__","CTAD for ``std::basic_format_args``","February 2023","","","|format|"
+"`3810 <https://wg21.link/LWG3810>`__","CTAD for ``std::basic_format_args``","February 2023","|Complete|","17.0","|format|"
 "`3827 <https://wg21.link/LWG3827>`__","Deprecate ``<stdalign.h>`` and ``<stdbool.h>`` macros","February 2023","","",""
 "`3828 <https://wg21.link/LWG3828>`__","Sync ``intmax_t`` and ``uintmax_t`` with C2x","February 2023","","",""
 "`3833 <https://wg21.link/LWG3833>`__","Remove specialization ``template<size_t N> struct formatter<const charT[N], charT>``","February 2023","","","|format|"


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D144275.498476.patch
Type: text/x-patch
Size: 3225 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20230217/ec2eb8a7/attachment.bin>


More information about the libcxx-commits mailing list