From 53f1fafbc268130a70320d52989a746ad9a9d175 Mon Sep 17 00:00:00 2001 From: "A. Jiang" Date: Fri, 5 Jul 2024 15:36:52 +0800 Subject: [PATCH] Implement LWG-4106 `basic_format_args` should not be default-constructible (#4757) Co-authored-by: Stephan T. Lavavej --- stl/inc/format | 2 -- tests/libcxx/expected_results.txt | 4 ++++ .../tests/P0645R10_text_formatting_custom_formatting/test.cpp | 3 +++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/stl/inc/format b/stl/inc/format index 4b6c1441f..be7a99523 100644 --- a/stl/inc/format +++ b/stl/inc/format @@ -2079,8 +2079,6 @@ class _Format_arg_store<_Context> {}; _EXPORT_STD template class basic_format_args { public: - basic_format_args() noexcept = default; - basic_format_args(const _Format_arg_store<_Context>&) noexcept {} template diff --git a/tests/libcxx/expected_results.txt b/tests/libcxx/expected_results.txt index ebd56bb13..fa31a5e15 100644 --- a/tests/libcxx/expected_results.txt +++ b/tests/libcxx/expected_results.txt @@ -171,6 +171,10 @@ std/ranges/range.adaptors/range.lazy.split/range.lazy.split.outer.value/ctor.ite # libc++ doesn't implement LWG-4061 std/utilities/format/format.functions/bug_81590.compile.pass.cpp FAIL +# libc++ doesn't implement LWG-4106 +std/utilities/format/format.arguments/format.args/ctor.pass.cpp FAIL +std/utilities/format/format.arguments/format.args/get.pass.cpp FAIL + # If any feature-test macro test is failing, this consolidated test will also fail. std/language.support/support.limits/support.limits.general/version.version.compile.pass.cpp FAIL diff --git a/tests/std/tests/P0645R10_text_formatting_custom_formatting/test.cpp b/tests/std/tests/P0645R10_text_formatting_custom_formatting/test.cpp index 68e10a838..5c2c17327 100644 --- a/tests/std/tests/P0645R10_text_formatting_custom_formatting/test.cpp +++ b/tests/std/tests/P0645R10_text_formatting_custom_formatting/test.cpp @@ -280,6 +280,9 @@ void test_basic_format_context_construction() { static_assert(!is_constructible_with_trailing_empty_brace_impl); static_assert(!is_constructible_with_trailing_empty_brace_impl>); static_assert(!is_constructible_with_trailing_empty_brace_impl&>); + + // Also test LWG-4106 "basic_format_args should not be default-constructible" + static_assert(!is_default_constructible_v>); } // Test GH-4636 ": Call to next_arg_id may result in unexpected error (regression)"