libstdc++: Remove std::basic_format_args default constructor (LWG 4106)

There's no valid use case for default constructing this type, so the
committee approved removing the default constructor.

libstdc++-v3/ChangeLog:

	* include/std/format (basic_format_args): Remove default
	constructor, as per LWG 4106.
	* testsuite/std/format/arguments/args.cc: Check it isn't default
	constructible.
This commit is contained in:
Jonathan Wakely 2024-07-25 13:52:12 +01:00 committed by Thomas Koenig
parent 69270c7452
commit 436ef665d8
2 changed files with 4 additions and 2 deletions

View File

@ -3667,8 +3667,6 @@ namespace __format
{ return {_Format_arg::template _S_to_enum<_Args>()...}; }
public:
basic_format_args() noexcept = default;
template<typename... _Args>
basic_format_args(const _Store<_Args...>& __store) noexcept;

View File

@ -3,6 +3,10 @@
#include <format>
#include <testsuite_hooks.h>
// LWG 4106. basic_format_args should not be default-constructible
static_assert( ! std::is_default_constructible_v<std::format_args> );
static_assert( ! std::is_default_constructible_v<std::wformat_args> );
template<typename Ctx, typename T>
bool equals(std::basic_format_arg<Ctx> fmt_arg, T expected) {
return std::visit_format_arg([=](auto arg_val) {