From patchwork Mon Nov 18 12:28:39 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Wakely X-Patchwork-Id: 1196742 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-513903-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="Bvx0oioV"; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.b="FmN5VwaW"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47GpCv03Qqz9sQp for ; Mon, 18 Nov 2019 23:28:57 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:subject:message-id:mime-version:content-type; q=dns; s= default; b=OBm11+5RSby9gjziqXBByGs4HMRsyzftFeRnPhml9hgi6qjZLK+Po gL8GzmmTLk0vRZw3i2voN4EFOOuSBIqz7K95Cpgp2n+DDC4+8E95fJl+63+QT6z2 81NLZ3riGg3ct19okn4qnDBtkngVsGDmg0d4mw+b512/0xlwpzeGTw= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:subject:message-id:mime-version:content-type; s= default; bh=sWHIANy0dLPjh7+WKTSWpDfeZCw=; b=Bvx0oioVpG6DV3sL1Nll 0yKdGcKFVPixHZEZ+gHjyR7LmRbM7bYN5m9vxhehtZBmHOI0LDRt4aR31t6UGu7F hBpR2+9JbnI4PpTH+G9eQ6sBy/3eVGq/BuzpavLam5akYb9IxB2fF2z1RL/nxITd o5eyca2cQH5dye7bmHTanwE= Received: (qmail 82177 invoked by alias); 18 Nov 2019 12:28:46 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 82122 invoked by uid 89); 18 Nov 2019 12:28:45 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-17.2 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3 autolearn=ham version=3.3.1 spammy=HX-Languages-Length:2793 X-HELO: us-smtp-delivery-1.mimecast.com Received: from us-smtp-2.mimecast.com (HELO us-smtp-delivery-1.mimecast.com) (207.211.31.81) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 18 Nov 2019 12:28:44 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1574080122; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type; bh=QrrCPXkXYLGG7iddOuIkjJ2ym4jgu1+YJfkSH8TO06w=; b=FmN5VwaWSjTsFTJEm9Zq+n2iNLiuQjROJbPDUrVRpwnS9Ssrp70tmxi61QCHduRA3zHgnH NPGpH+ukkprl/FyKx0WXYSUxsd56VwZcEun9DTWFR8MXxT1BZGvh/dzUr8a5yaw+F3QDY3 JkgjAaG3USlqrcCfHJ1jDcOd+ca65h8= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-175-dYmukAElNEqlt9uCTLf2-w-1; Mon, 18 Nov 2019 07:28:40 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B38A61005510; Mon, 18 Nov 2019 12:28:39 +0000 (UTC) Received: from localhost (unknown [10.33.36.113]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6305960905; Mon, 18 Nov 2019 12:28:39 +0000 (UTC) Date: Mon, 18 Nov 2019 12:28:39 +0000 From: Jonathan Wakely To: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: [PATCH] libstdc++: Fix some -Wsystem-headers warnings Message-ID: <20191118122839.GA13259@redhat.com> MIME-Version: 1.0 X-Clacks-Overhead: GNU Terry Pratchett User-Agent: Mutt/1.12.1 (2019-06-15) X-Mimecast-Spam-Score: 0 Content-Disposition: inline * include/bits/alloc_traits.h (allocator_traits::construct) (allocator_traits::destroy, allocator_traits::max_size): Add unused attributes to parameters that are not used in C++20. * include/std/bit (__ceil2): Add braces around assertion to avoid -Wmissing-braces warning. Tested powerpc64le-linux, committed to trunk. commit 6b497406d256373343b5e2237631d3cc4df713b7 Author: Jonathan Wakely Date: Mon Nov 18 11:48:35 2019 +0000 libstdc++: Fix some -Wsystem-headers warnings * include/bits/alloc_traits.h (allocator_traits::construct) (allocator_traits::destroy, allocator_traits::max_size): Add unused attributes to parameters that are not used in C++20. * include/std/bit (__ceil2): Add braces around assertion to avoid -Wmissing-braces warning. diff --git a/libstdc++-v3/include/bits/alloc_traits.h b/libstdc++-v3/include/bits/alloc_traits.h index 55211ac1d72..142b23fe00f 100644 --- a/libstdc++-v3/include/bits/alloc_traits.h +++ b/libstdc++-v3/include/bits/alloc_traits.h @@ -499,8 +499,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION */ template static _GLIBCXX20_CONSTEXPR void - construct(allocator_type& __a, _Up* __p, _Args&&... __args) - noexcept(noexcept(::new((void*)__p) _Up(std::forward<_Args>(__args)...))) + construct(allocator_type& __a __attribute__((__unused__)), _Up* __p, + _Args&&... __args) + noexcept(noexcept(::new((void*)__p) _Up(std::declval<_Args>()...))) { #if __cplusplus <= 201703L __a.construct(__p, std::forward<_Args>(__args)...); @@ -518,7 +519,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION */ template static _GLIBCXX20_CONSTEXPR void - destroy(allocator_type& __a, _Up* __p) + destroy(allocator_type& __a __attribute__((__unused__)), _Up* __p) noexcept(is_nothrow_destructible<_Up>::value) { #if __cplusplus <= 201703L @@ -534,7 +535,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION * @return @c __a.max_size() */ static _GLIBCXX20_CONSTEXPR size_type - max_size(const allocator_type& __a) noexcept + max_size(const allocator_type& __a __attribute__((__unused__))) noexcept { #if __cplusplus <= 201703L return __a.max_size(); diff --git a/libstdc++-v3/include/std/bit b/libstdc++-v3/include/std/bit index e89bca2c359..7b5253b104c 100644 --- a/libstdc++-v3/include/std/bit +++ b/libstdc++-v3/include/std/bit @@ -225,7 +225,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION // by UBSan, and by debug assertions. #ifdef _GLIBCXX_HAVE_BUILTIN_IS_CONSTANT_EVALUATED if (!__builtin_is_constant_evaluated()) - __glibcxx_assert( __shift_exponent != numeric_limits<_Tp>::digits ); + { + __glibcxx_assert( __shift_exponent != numeric_limits<_Tp>::digits ); + } #endif using __promoted_type = decltype(__x << 1); if _GLIBCXX17_CONSTEXPR (!is_same<__promoted_type, _Tp>::value)