From patchwork Fri Dec 9 00:36:11 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Wakely X-Patchwork-Id: 1714014 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org 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=sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha256 header.s=default header.b=ER5+L9pA; dkim-atps=neutral Received: from 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 (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4NSsYg3Bmzz23pG for ; Fri, 9 Dec 2022 11:37:43 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 5CC463953076 for ; Fri, 9 Dec 2022 00:37:41 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5CC463953076 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1670546261; bh=UEQc1HLtwAiBvdpgO31fhk7626Bs9Zl9V/1Wf6kmGHw=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=ER5+L9pArfy6Cr4BfAjXbaq0CEznatYkz9KiJ0Q3My35JCLPUyGqzc21iCXnSqGe1 7dA8NGm8HIiys1r3GXwGRzqrmKcWjAK0qIHGlAL6yRkyGB4wJ8k7Cp+WvEeYRgqdNe VrG71meTxqDp7ZRnll+K2rckt940ouDaIX+q6ENk= 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 074643840134 for ; Fri, 9 Dec 2022 00:36:17 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 074643840134 Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-207-sbEy-vDYNu6h8ahjPkv99g-1; Thu, 08 Dec 2022 19:36:15 -0500 X-MC-Unique: sbEy-vDYNu6h8ahjPkv99g-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id D88733C0DDCB; Fri, 9 Dec 2022 00:36:14 +0000 (UTC) Received: from localhost (unknown [10.33.36.3]) by smtp.corp.redhat.com (Postfix) with ESMTP id 871391121331; Fri, 9 Dec 2022 00:36:14 +0000 (UTC) To: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: [committed] libstdc++: Fix some -Wunused warnings in tests Date: Fri, 9 Dec 2022 00:36:11 +0000 Message-Id: <20221209003611.443110-1-jwakely@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-12.2 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_H2, SPF_HELO_NONE, SPF_NONE, TXREP 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.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+incoming=patchwork.ozlabs.org@gcc.gnu.org Sender: "Gcc-patches" Tested x86_64-linux. Pushed to trunk. -- >8 -- libstdc++-v3/ChangeLog: * include/ext/pb_ds/detail/type_utils.hpp (PB_DS_STATIC_ASSERT): Add unused attribute to avoid -Wunused-local-typedef warnings. * testsuite/17_intro/tag_type_explicit_ctor.cc: Add pragma to ignore -Wunused-variable warnings --- libstdc++-v3/include/ext/pb_ds/detail/type_utils.hpp | 3 ++- libstdc++-v3/testsuite/17_intro/tag_type_explicit_ctor.cc | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/libstdc++-v3/include/ext/pb_ds/detail/type_utils.hpp b/libstdc++-v3/include/ext/pb_ds/detail/type_utils.hpp index 52d05392975..c3db6c93ea6 100644 --- a/libstdc++-v3/include/ext/pb_ds/detail/type_utils.hpp +++ b/libstdc++-v3/include/ext/pb_ds/detail/type_utils.hpp @@ -152,7 +152,8 @@ namespace __gnu_pbds }; #define PB_DS_STATIC_ASSERT(UNIQUE, E) \ - typedef __gnu_pbds::detail::__static_assert_dumclass)> UNIQUE##__static_assert_type + typedef __gnu_pbds::detail::__static_assert_dumclass)> \ + UNIQUE##__static_assert_type __attribute__((__unused__)) #endif diff --git a/libstdc++-v3/testsuite/17_intro/tag_type_explicit_ctor.cc b/libstdc++-v3/testsuite/17_intro/tag_type_explicit_ctor.cc index 410142d3974..fead30f63c3 100644 --- a/libstdc++-v3/testsuite/17_intro/tag_type_explicit_ctor.cc +++ b/libstdc++-v3/testsuite/17_intro/tag_type_explicit_ctor.cc @@ -34,6 +34,8 @@ void f5(std::try_to_lock_t); void f6(std::adopt_lock_t); #endif +#pragma GCC diagnostic ignored "-Wunused-variable" + int main() { std::nothrow_t v1;