From patchwork Wed Aug 28 20:41:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Wakely X-Patchwork-Id: 1978078 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=J/HSBWi/; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; 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 [IPv6:2620:52:3:1:0:246e:9693:128c]) (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 4WvGYt45Ytz1yXd for ; Thu, 29 Aug 2024 06:42:26 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 63532385DDE6 for ; Wed, 28 Aug 2024 20:42:24 +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.129.124]) by sourceware.org (Postfix) with ESMTP id 822433858D39 for ; Wed, 28 Aug 2024 20:41:56 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 822433858D39 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 822433858D39 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1724877718; cv=none; b=ghMUwx1JztIHxwANiAURv71Y8Du0jpmPZ0jmvwJ9HqtdY1v3F8PUdadIt9d1bY9VKo7UZkQs9p+17GMwveL7OdiMHV5vMnPgacNUM5lXaR1P9G8URSxGWtFzggFNAh8ljYVMH/qvUkAmaOAsr5MsmFHuVmoF4iSCQhsyFbrYGOk= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1724877718; c=relaxed/simple; bh=BNoJHumZLot67tH2zNoxnkhI19t4X7ZbgP+BdsCXkC0=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=ioyrfADqdcGve3p3LDCHtGXRCNGJjOhBIoLuFkAgqt/JYQ6JNU7FN8O6J1XvZp75DWiJACkEfxlsJ/r5u/Z/UI/dAfjA26HTyv32RU7P59+63IkFx3YAh9VU2VFa5zvo/EPOucGNRiihzAqiVDF/i71kQN1IO8OmTg3L7PuInpo= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1724877716; 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: in-reply-to:in-reply-to:references:references; bh=1+g1gyWCOZqRA6JGKZJXVmB2JnEqxsw6OeQnz9LsBZo=; b=J/HSBWi/dk/VIeWNrR7ipU3eBOohb5oSvFcFG4E4GzzcNNHlQnZ3W1qWwJtG5PVhA5fKGE e5XjIm/YAffuU4mzaeNBxPq0Wxc7ZELTFUiaYQg+QOcm92hj686oABa8gr3E/p8cd5qH1f PgqrByBDY1vVqI2WTBFkJqdgXrC68G0= Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-251-DDQCptfLMPOpzbpXwKt88A-1; Wed, 28 Aug 2024 16:41:54 -0400 X-MC-Unique: DDQCptfLMPOpzbpXwKt88A-1 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 86D591955BF8; Wed, 28 Aug 2024 20:41:53 +0000 (UTC) Received: from localhost (unknown [10.42.28.101]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 9EA7019560A3; Wed, 28 Aug 2024 20:41:52 +0000 (UTC) From: Jonathan Wakely To: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org Cc: Jason Merrill Subject: [committed,2/2] libstdc++: Fix -Wunused-variable warning in Date: Wed, 28 Aug 2024 21:41:13 +0100 Message-ID: <20240828204151.1861983-1-jwakely@redhat.com> In-Reply-To: <20240828204052.1861826-1-jwakely@redhat.com> References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-12.0 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_H3, 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-linux. Pushed to trunk. -- >8 -- libstdc++-v3/ChangeLog: * include/std/format (format_parse_context::check_dynamic_spec): Add [[maybe_unused]] attribute and comment. --- libstdc++-v3/include/std/format | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libstdc++-v3/include/std/format b/libstdc++-v3/include/std/format index 3280dadfb90..52243eb5479 100644 --- a/libstdc++-v3/include/std/format +++ b/libstdc++-v3/include/std/format @@ -4323,6 +4323,11 @@ namespace __format constexpr void basic_format_parse_context<_CharT>::check_dynamic_spec(size_t __id) noexcept { + // This call enforces the Mandates: condition that _Ts contains valid + // types and each type appears at most once. It could be a static_assert + // but this way failures give better diagnostics, due to calling the + // non-constexpr __invalid_dynamic_spec function. + [[maybe_unused]] constexpr bool __ok = __check_dynamic_spec_types<_Ts...>(); if consteval {