From patchwork Thu Aug 24 12:45:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Wakely X-Patchwork-Id: 136819 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:a7d1:0:b0:3f2:4152:657d with SMTP id p17csp1094200vqm; Thu, 24 Aug 2023 05:49:28 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE/4qo3hggvFB7rFJ1DtC9HctO48TlSziL9kY99dKANgFd39D9k4y8LHsfe8B4p4AKKFO3d X-Received: by 2002:ac2:55a7:0:b0:500:8fcd:c3b5 with SMTP id y7-20020ac255a7000000b005008fcdc3b5mr4433157lfg.12.1692881368092; Thu, 24 Aug 2023 05:49:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692881368; cv=none; d=google.com; s=arc-20160816; b=WRsofus10T22dRuP/9xKPxT2VBKfgig/RSLCvmTc6Y/gJeIXaezhVXKK1ZitWGS/Sa nbGMbat84+MjrNb5oPtkmWawbqQ2R2vrTNebRHLj7cJXILVy6ds4Vw1Hwr6P41Bkf36+ 6Pruby1TIgtv25B7a0lBiV8mv6S2AlGuFvazkHlvWKy2O+zJRu0CmGlM/KOXqGN3XQwx eZk2El5Iz0Y1ZotQxxSxov04hSHYohfb5fG/f7H9yp16ENXzg0hdqIQTttIeLYQxIUPV BVKP3uUnrIXqnqZHJoDsyLMDuulmp79KGw7Ayxb23XDZLLrtbXiuL/sAnJgQD9M+rYz/ ktbQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence :content-transfer-encoding:mime-version:message-id:date:subject:to :dmarc-filter:delivered-to:dkim-signature:dkim-filter; bh=FetpJwy8s/BtSm/+Jto8onrlivva5gTbPd7vzvaTjs0=; fh=sC8lnOfyH6gL5FYlMbZ1VDz6qVPMj/3ViLJWKNUCUgQ=; b=jMeAL5PSI3JrKkcfyvQLfbdt3ju47wPY+xeMSymXl133VO0yUVJ6n7EkkSBWiieUry bSv9cGtk+9uKk4UKV5Uz30wEN6ZSFyYyPdg7LntDglIkyVirC3x5obBkgTICtJDvnYpE 5/bqPAHGOgpmwfe2IKaM9mYgNm7lKjiqS2Y+wqGGEYFV1MC6wPZ7DbIcxHjZc3l29vWr 2EfZTSJuQCFjgmMnA6jC5oq+pb6kN/xHM5ohaoHZ4K15XY2ukC2c+37cPmfsGrIImC2x KjsYRDVFRoV8MHvoQqXGnaPhO+cDC2bZb5NaLGCbTAOoaqYONeycs97rusQ2iSfjKYEs aL8Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=oexTJs4V; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (ip-8-43-85-97.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id bf16-20020a0564021a5000b005233ef72dbfsi10316373edb.27.2023.08.24.05.49.27 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Aug 2023 05:49:28 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=oexTJs4V; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 1A5EE3882100 for ; Thu, 24 Aug 2023 12:46:59 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1A5EE3882100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1692881219; bh=FetpJwy8s/BtSm/+Jto8onrlivva5gTbPd7vzvaTjs0=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=oexTJs4VkONY+d8MpEXq7lbSXiWk93YGmwVLxY5BEw2F4XLK/Rtu1g3g/frryVwBG rr8PA+ySJSjIW1vSsOb/jzH/Jb3jdDJYrKbhJ7ccrVlNVIVkGkGZgNZt9EfhjwT9Zu Bd1o5i9d+zaVn5tWSENs8zcSBwAc2kBdmQix4Oq8= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 7E9B03882117 for ; Thu, 24 Aug 2023 12:45:54 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 7E9B03882117 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-633-KupAiIAlNq20ThquhwVHcQ-1; Thu, 24 Aug 2023 08:45:50 -0400 X-MC-Unique: KupAiIAlNq20ThquhwVHcQ-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 81111101A52E; Thu, 24 Aug 2023 12:45:50 +0000 (UTC) Received: from localhost (unknown [10.42.28.204]) by smtp.corp.redhat.com (Postfix) with ESMTP id 48F402026D68; Thu, 24 Aug 2023 12:45:50 +0000 (UTC) To: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: [committed] libstdc++: Fix -Wunused-but-set-variable in std::format_to test Date: Thu, 24 Aug 2023 13:45:37 +0100 Message-ID: <20230824124549.443683-1-jwakely@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-11.8 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Jonathan Wakely via Gcc-patches From: Jonathan Wakely Reply-To: Jonathan Wakely Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1775114773067298044 X-GMAIL-MSGID: 1775114773067298044 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(-) diff --git a/libstdc++-v3/testsuite/std/format/functions/format_to.cc b/libstdc++-v3/testsuite/std/format/functions/format_to.cc index a35568954e2..c5c3c503625 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!" ); }