From 8caa8d95afe47db91d8a4e123ad2deac63d44754 Mon Sep 17 00:00:00 2001 From: Mark de Wever Date: Fri, 17 Feb 2023 18:10:14 +0100 Subject: [PATCH] [libc++][format] Addresses LWG3810. LWG3810 CTAD for std::basic_format_args Reviewed By: #libc, philnik Differential Revision: https://reviews.llvm.org/D144275 --- libcxx/docs/Status/Cxx2bIssues.csv | 2 +- libcxx/include/__format/format_args.h | 4 ++- .../format.args/ctad.compile.pass.cpp | 31 ++++++++++++++++++++++ 3 files changed, 35 insertions(+), 2 deletions(-) create mode 100644 libcxx/test/std/utilities/format/format.arguments/format.args/ctad.compile.pass.cpp diff --git a/libcxx/docs/Status/Cxx2bIssues.csv b/libcxx/docs/Status/Cxx2bIssues.csv index 6162e72..f03e118 100644 --- a/libcxx/docs/Status/Cxx2bIssues.csv +++ b/libcxx/docs/Status/Cxx2bIssues.csv @@ -286,7 +286,7 @@ "`3772 `__","``repeat_view``'s ``piecewise`` constructor is missing Postconditions","February 2023","","","|ranges|" "`3786 `__","Flat maps' deduction guide needs to default ``Allocator`` to be useful","February 2023","","","" "`3803 `__","``flat_foo`` constructors taking ``KeyContainer`` lack ``KeyCompare`` parameter","February 2023","","","" -"`3810 `__","CTAD for ``std::basic_format_args``","February 2023","","","|format|" +"`3810 `__","CTAD for ``std::basic_format_args``","February 2023","|Complete|","17.0","|format|" "`3827 `__","Deprecate ```` and ```` macros","February 2023","","","" "`3828 `__","Sync ``intmax_t`` and ``uintmax_t`` with C2x","February 2023","","","" "`3833 `__","Remove specialization ``template struct formatter``","February 2023","","","|format|" diff --git a/libcxx/include/__format/format_args.h b/libcxx/include/__format/format_args.h index 762ae44..32f1de9 100644 --- a/libcxx/include/__format/format_args.h +++ b/libcxx/include/__format/format_args.h @@ -71,7 +71,9 @@ private: const basic_format_arg<_Context>* __args_; }; }; -_LIBCPP_CTAD_SUPPORTED_FOR_TYPE(basic_format_args); + +template +basic_format_args(__format_arg_store<_Context, _Args...>) -> basic_format_args<_Context>; #endif //_LIBCPP_STD_VER >= 20 diff --git a/libcxx/test/std/utilities/format/format.arguments/format.args/ctad.compile.pass.cpp b/libcxx/test/std/utilities/format/format.arguments/format.args/ctad.compile.pass.cpp new file mode 100644 index 0000000..b500b1e --- /dev/null +++ b/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 + +// + +// template +// basic_format_args(format-arg-store) -> basic_format_args; + +#include +#include + +#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>); + +#ifndef TEST_HAS_NO_WIDE_CHARACTERS + static_assert(std::same_as>); + +#endif +} -- 2.7.4