diff options
author | Jonathan Wakely <jwakely@redhat.com> | 2024-07-25 13:52:12 +0100 |
---|---|---|
committer | Jonathan Wakely <redi@gcc.gnu.org> | 2024-07-25 23:10:35 +0100 |
commit | 5be55447e256302324f38f04316a437909ae5847 (patch) | |
tree | 40a03581eb2a27950570841069cc465f96c675f3 /libstdc++-v3/testsuite/std | |
parent | 1489e281b549af8a76a415556c07e147df933a44 (diff) | |
download | gcc-5be55447e256302324f38f04316a437909ae5847.zip gcc-5be55447e256302324f38f04316a437909ae5847.tar.gz gcc-5be55447e256302324f38f04316a437909ae5847.tar.bz2 |
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.
Diffstat (limited to 'libstdc++-v3/testsuite/std')
-rw-r--r-- | libstdc++-v3/testsuite/std/format/arguments/args.cc | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libstdc++-v3/testsuite/std/format/arguments/args.cc b/libstdc++-v3/testsuite/std/format/arguments/args.cc index eba129f..16ca71c 100644 --- a/libstdc++-v3/testsuite/std/format/arguments/args.cc +++ b/libstdc++-v3/testsuite/std/format/arguments/args.cc @@ -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) { |