Skip to content

Commit

Permalink
Implement LWG-4106 basic_format_args should not be default-construc…
Browse files Browse the repository at this point in the history
…tible (#4757)

Co-authored-by: Stephan T. Lavavej <stl@nuwen.net>
  • Loading branch information
frederick-vs-ja and StephanTLavavej authored Jul 5, 2024
1 parent 679783a commit 53f1faf
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
2 changes: 0 additions & 2 deletions stl/inc/format
Original file line number Diff line number Diff line change
Expand Up @@ -2079,8 +2079,6 @@ class _Format_arg_store<_Context> {};
_EXPORT_STD template <class _Context>
class basic_format_args {
public:
basic_format_args() noexcept = default;

basic_format_args(const _Format_arg_store<_Context>&) noexcept {}

template <class... _Args>
Expand Down
4 changes: 4 additions & 0 deletions tests/libcxx/expected_results.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,9 @@ void test_basic_format_context_construction() {
static_assert(!is_constructible_with_trailing_empty_brace_impl<context>);
static_assert(!is_constructible_with_trailing_empty_brace_impl<context, OutIt, basic_format_args<context>>);
static_assert(!is_constructible_with_trailing_empty_brace_impl<context, OutIt, const basic_format_args<context>&>);

// Also test LWG-4106 "basic_format_args should not be default-constructible"
static_assert(!is_default_constructible_v<basic_format_args<context>>);
}

// Test GH-4636 "<format>: Call to next_arg_id may result in unexpected error (regression)"
Expand Down

0 comments on commit 53f1faf

Please sign in to comment.