From a597ebc3d328353ef1c44392ea1b2472bca52988 Mon Sep 17 00:00:00 2001 From: "A. Jiang" Date: Tue, 9 Jul 2024 07:45:43 +0800 Subject: [PATCH] [libc++][format] Implement LWG4106 --- libcxx/docs/Status/Cxx2cIssues.csv | 2 +- libcxx/include/__format/format_args.h | 2 -- .../format/format.arguments/format.args/ctor.pass.cpp | 9 ++------- .../format/format.arguments/format.args/get.pass.cpp | 8 +------- 4 files changed, 4 insertions(+), 17 deletions(-) diff --git a/libcxx/docs/Status/Cxx2cIssues.csv b/libcxx/docs/Status/Cxx2cIssues.csv index 18cbe8f8b738a..b2f4929b54591 100644 --- a/libcxx/docs/Status/Cxx2cIssues.csv +++ b/libcxx/docs/Status/Cxx2cIssues.csv @@ -74,7 +74,7 @@ "`4096 `__","``views::iota(views::iota(0))`` should be rejected","St. Louis June 2024","","","|ranges|" "`4098 `__","``views::adjacent<0>`` should reject non-forward ranges","St. Louis June 2024","","","|ranges|" "`4105 `__","``ranges::ends_with``\`s Returns misses difference casting","St. Louis June 2024","","","|ranges|" -"`4106 `__","``basic_format_args`` should not be default-constructible","St. Louis June 2024","","","|format|" +"`4106 `__","``basic_format_args`` should not be default-constructible","St. Louis June 2024","|Complete|","19.0","|format|" "","","","","","" "`3343 `__","Ordering of calls to ``unlock()`` and ``notify_all()`` in Effects element of ``notify_all_at_thread_exit()`` should be reversed","Not Yet Adopted","|Complete|","16.0","" "XXXX","","The sys_info range should be affected by save","Not Yet Adopted","|Complete|","19.0" diff --git a/libcxx/include/__format/format_args.h b/libcxx/include/__format/format_args.h index a5fde36a29817..07923570f3893 100644 --- a/libcxx/include/__format/format_args.h +++ b/libcxx/include/__format/format_args.h @@ -28,8 +28,6 @@ _LIBCPP_BEGIN_NAMESPACE_STD template class _LIBCPP_TEMPLATE_VIS basic_format_args { public: - basic_format_args() noexcept = default; - template _LIBCPP_HIDE_FROM_ABI basic_format_args(const __format_arg_store<_Context, _Args...>& __store) noexcept : __size_(sizeof...(_Args)) { diff --git a/libcxx/test/std/utilities/format/format.arguments/format.args/ctor.pass.cpp b/libcxx/test/std/utilities/format/format.arguments/format.args/ctor.pass.cpp index c0575c545bde3..bb542a8e63ecf 100644 --- a/libcxx/test/std/utilities/format/format.arguments/format.args/ctor.pass.cpp +++ b/libcxx/test/std/utilities/format/format.arguments/format.args/ctor.pass.cpp @@ -9,12 +9,12 @@ // -// basic_format_args() noexcept; // template // basic_format_args(const format-arg-store& store) noexcept; #include #include +#include #include "test_macros.h" @@ -24,12 +24,7 @@ void test() { char c = 'c'; nullptr_t p = nullptr; using Context = std::basic_format_context; - { - ASSERT_NOEXCEPT(std::basic_format_args{}); - - std::basic_format_args format_args{}; - assert(!format_args.get(0)); - } + static_assert(!std::is_default_constructible_v>); { auto store = std::make_format_args(i); ASSERT_NOEXCEPT(std::basic_format_args{store}); diff --git a/libcxx/test/std/utilities/format/format.arguments/format.args/get.pass.cpp b/libcxx/test/std/utilities/format/format.arguments/format.args/get.pass.cpp index c590cebf48acc..80439483414cc 100644 --- a/libcxx/test/std/utilities/format/format.arguments/format.args/get.pass.cpp +++ b/libcxx/test/std/utilities/format/format.arguments/format.args/get.pass.cpp @@ -81,13 +81,7 @@ void test_string_view(From value) { template void test() { - using Context = std::basic_format_context; - { - const std::basic_format_args format_args{}; - ASSERT_NOEXCEPT(format_args.get(0)); - assert(!format_args.get(0)); - } - + using Context = std::basic_format_context; using char_type = typename Context::char_type; std::basic_string empty; std::basic_string str = MAKE_STRING(char_type, "abc");