mirror of git://gcc.gnu.org/git/gcc.git
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:
parent
69270c7452
commit
436ef665d8
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue