From patchwork Wed Aug 28 09:35:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Merrill X-Patchwork-Id: 1977711 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=HYClhJdl; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Wtzqv6tSXz1yfn for ; Wed, 28 Aug 2024 19:38:34 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id DE4993860753 for ; Wed, 28 Aug 2024 09:38:32 +0000 (GMT) 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.133.124]) by sourceware.org (Postfix) with ESMTP id 61202386076C for ; Wed, 28 Aug 2024 09:38:09 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 61202386076C Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 61202386076C Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1724837890; cv=none; b=xoKgR1I0jvtWQKOOcn/4SLiQsuMHlWXaLHsXupberAGNi7ecaV4N/QciA/gs2/k6DNX7GRWmvkd9dwmoqrBnL4Xw7gRBAF/jVHOsruLNy0kvFTv2qkGQMYAtTtp8oLQ+8GBuAWBasPsGsvtwHnF1MBRhP55SLs6ao9+hoPrI51Y= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1724837890; c=relaxed/simple; bh=YqJ5QIQ5l3gdn8AIZj2dfzjEphPFb1otKbj18y7fZgs=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=n8V/x6yxN7BUde/xymuUYq0iWiU7cXOqVGJ3fF9KY9+IgH0NARvYvCi4zSUevln9tCvEssuT/6BhepRqGvcxsgQuYlVUl71FMe+L+jYBKmbq4X6KMDqi79lJfyLp3v8OiSMxMZDHc1LvGqeRxd42MtuTxDQFfYaAGFSKfSRMsVU= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1724837889; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6SVwS8h7f2r58h4PRifXlal0TfxHXOzS9UeBcox6zwQ=; b=HYClhJdldIVEuS93T8MHte1GN29UTGTWtgUcsOTWymSRKwvHN9oY9FIYZDOVbqKstYEB8U DnERL8o8AEDRfZ0DDgXHUO+b5P+4OOG4Ddff/FnmqO8c/aaGmTQxlqXMfjVvthXcaNmvhc v8DympbgI1s/5/5JD4srDysdbc9q1P0= Received: from mail-qk1-f199.google.com (mail-qk1-f199.google.com [209.85.222.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-618-pGf4e6esPByWcXsG2Uh5zg-1; Wed, 28 Aug 2024 05:38:07 -0400 X-MC-Unique: pGf4e6esPByWcXsG2Uh5zg-1 Received: by mail-qk1-f199.google.com with SMTP id af79cd13be357-7a1d9a712bcso95665485a.1 for ; Wed, 28 Aug 2024 02:38:07 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724837887; x=1725442687; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=6SVwS8h7f2r58h4PRifXlal0TfxHXOzS9UeBcox6zwQ=; b=PVYOMdvrspCYXme8/q9i0wH3yhBIwmPE4AOY8b9JWE3mZxAl6tHEy9t+XyAqA7NVib Au/8U4XPgsorcknf+n/mMSQ2mAt+NZniYA1HnBt3liMzhrYXKRkPoUH69UR+Ii4fy261 rzneUN9xoirGOexZ/SmvEszIX1XYKl0rwb5G3PdHmVfCnR3pHJa18oC70ZZ0kxF9GIzc 1uq1qlEiyxCBJ/TxAnBRnhGiuXX+Fg3mPJMjFl2FeuWnIHHtvNCITJB7xWXCGUZyEIHY 7TkX3QZ4t9AXHkyXXLgf00CCXN3o9/ac0hBTmEtBGB4iNyEs4GvQvKTfW0LAB9AFez95 MF9A== X-Gm-Message-State: AOJu0YyWxwDcGDiOmQSt55KiN36x9MfyG0L84RNCDlaj5UW7mKd/Jz9R xrPM0BiHXy3g+o6JjWgrXq0Eh6JjwHjmeA69mKl0OTnAGW9avRd5zEU3dNu32lDOWApXsxQBLAO BAZKdNFylYUqOBUeSFlFl7Vur9NyCdxSiqCsHYQQzTWs5WAQaTOaxgljcSJxevDxLnAcR4ayYYY G5+jFN+TQ3SWh3D4g6zOQiATY9gUjwTAJ/f7c= X-Received: by 2002:a05:6214:448e:b0:6c1:84ce:8f31 with SMTP id 6a1803df08f44-6c335c60e6emr31069606d6.0.1724837886754; Wed, 28 Aug 2024 02:38:06 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGMf9nkzjn90Vnl86+TFH1h1AKmFTKJXqr5hOT9UiUomVmrb0R6MwQOQTx7pe/Yc1jm7nojDA== X-Received: by 2002:a05:6214:448e:b0:6c1:84ce:8f31 with SMTP id 6a1803df08f44-6c335c60e6emr31069366d6.0.1724837886309; Wed, 28 Aug 2024 02:38:06 -0700 (PDT) Received: from jason-thinkpadp1gen4i.rmtusma.csb (130-44-146-16.s12558.c3-0.arl-cbr1.sbo-arl.ma.cable.rcncustomer.com. [130.44.146.16]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-6c162d4c5c4sm64023476d6.37.2024.08.28.02.38.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Aug 2024 02:38:05 -0700 (PDT) From: Jason Merrill To: gcc-patches@gcc.gnu.org Cc: libstdc++@gcc.gnu.org Subject: [PATCH] libstdc++: unused local declarations Date: Wed, 28 Aug 2024 05:35:24 -0400 Message-ID: <20240828093804.1682841-1-jason@redhat.com> X-Mailer: git-send-email 2.46.0 MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-13.5 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, T_SCC_BODY_TEXT_LINE autolearn=ham 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.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org Tested x86_64-pc-linux-gnu. OK for trunk, or were these supposed to be used? -- 8< -- The __ok variable and _RefT typedef aren't used in the rest of their blocks. Should they be? libstdc++-v3/ChangeLog: * include/std/format (check_dynamic_spec): Add [[maybe_unused]]. * include/std/ranges (to): Likewise. --- libstdc++-v3/include/std/format | 1 + libstdc++-v3/include/std/ranges | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) base-commit: 48032f28ad4bc5e810c303229bcaa223a0c4d09f diff --git a/libstdc++-v3/include/std/format b/libstdc++-v3/include/std/format index 3280dadfb90..376169018ba 100644 --- a/libstdc++-v3/include/std/format +++ b/libstdc++-v3/include/std/format @@ -4323,6 +4323,7 @@ namespace __format constexpr void basic_format_parse_context<_CharT>::check_dynamic_spec(size_t __id) noexcept { + [[maybe_unused]] constexpr bool __ok = __check_dynamic_spec_types<_Ts...>(); if consteval { diff --git a/libstdc++-v3/include/std/ranges b/libstdc++-v3/include/std/ranges index b7c7aa36ddc..008461e556b 100644 --- a/libstdc++-v3/include/std/ranges +++ b/libstdc++-v3/include/std/ranges @@ -9327,7 +9327,7 @@ namespace __detail std::forward<_Args>(__args)...); else { - using _RefT = range_reference_t<_Rg>; + using _RefT [[maybe_unused]] = range_reference_t<_Rg>; static_assert(constructible_from<_Cont, _Args...>); _Cont __c(std::forward<_Args>(__args)...); if constexpr (sized_range<_Rg>