From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2181) id D058F385E021; Thu, 24 Aug 2023 12:45:06 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D058F385E021 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1692881106; bh=l8tQKPZTWhMTzr/c8aMkVWcbSMzDK1y8viFGRVVMTSI=; h=From:To:Subject:Date:From; b=XdVMkDHJhehlOPxBfvh7FafmLTKf6AxrJ7o1gDqV0MYUJfxlIWh/6d6GUO3uzyhZ0 ljCOi2ELo4c9sL9VY/Z+NB8eqtnhjTMQipHBHKKl092RHEn27rhhQWi3tnYDGeFe5g GzihzmEGx76IlfrhU4yXB3bYSIouZ7oaeFX9u3Vs= MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Jonathan Wakely To: gcc-cvs@gcc.gnu.org, libstdc++-cvs@gcc.gnu.org Subject: [gcc r14-3456] libstdc++: Fix -Wunused-but-set-variable in std::format_to test X-Act-Checkin: gcc X-Git-Author: Jonathan Wakely X-Git-Refname: refs/heads/master X-Git-Oldrev: e64ad2c84f5ff1922b3f4f5a9af0ad03280e52e1 X-Git-Newrev: d6271d600d5a181b37093c8984990806a743f16a Message-Id: <20230824124506.D058F385E021@sourceware.org> Date: Thu, 24 Aug 2023 12:45:06 +0000 (GMT) List-Id: https://gcc.gnu.org/g:d6271d600d5a181b37093c8984990806a743f16a commit r14-3456-gd6271d600d5a181b37093c8984990806a743f16a Author: Jonathan Wakely Date: Thu Aug 24 11:42:17 2023 +0100 libstdc++: Fix -Wunused-but-set-variable in std::format_to test libstdc++-v3/ChangeLog: * testsuite/std/format/functions/format_to.cc: Avoid warning for unused variables. Diff: --- libstdc++-v3/testsuite/std/format/functions/format_to.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libstdc++-v3/testsuite/std/format/functions/format_to.cc b/libstdc++-v3/testsuite/std/format/functions/format_to.cc index a35568954e2c..c5c3c503625c 100644 --- a/libstdc++-v3/testsuite/std/format/functions/format_to.cc +++ b/libstdc++-v3/testsuite/std/format/functions/format_to.cc @@ -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 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!" ); }