[committed] libstdc++: Fix -Wunused-but-set-variable in std::format_to test
Checks
Commit Message
Tested x86_64-linux. Pushed to trunk.
-- >8 --
libstdc++-v3/ChangeLog:
* testsuite/std/format/functions/format_to.cc: Avoid warning for
unused variables.
---
libstdc++-v3/testsuite/std/format/functions/format_to.cc | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
@@ -69,14 +69,14 @@ test_move_only()
{
std::string str;
move_only_iterator mo(std::back_inserter(str));
- auto res = std::format_to(std::move(mo), "for{:.3} that{:c}",
- "matte", (int)'!');
+ [[maybe_unused]] auto res
+ = std::format_to(std::move(mo), "for{:.3} that{:c}", "matte", (int)'!');
VERIFY( str == "format that!" );
std::vector<wchar_t> vec;
move_only_iterator wmo(std::back_inserter(vec));
- auto wres = std::format_to(std::move(wmo), L"for{:.3} hat{:c}",
- L"matte", (long)L'!');
+ [[maybe_unused]] auto wres
+ = std::format_to(std::move(wmo), L"for{:.3} hat{:c}", L"matte", (long)L'!');
VERIFY( std::wstring_view(vec.data(), vec.size()) == L"format hat!" );
}