From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by sourceware.org (Postfix) with ESMTP id 6898B3947C02 for ; Fri, 12 Feb 2021 14:46:32 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 6898B3947C02 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-579-Y_lQXADFNfqLBnFveI5A8A-1; Fri, 12 Feb 2021 09:46:29 -0500 X-MC-Unique: Y_lQXADFNfqLBnFveI5A8A-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id D0C8F108C2AD; Fri, 12 Feb 2021 14:46:11 +0000 (UTC) Received: from localhost (unknown [10.33.36.155]) by smtp.corp.redhat.com (Postfix) with ESMTP id 76EA460BE5; Fri, 12 Feb 2021 14:46:11 +0000 (UTC) Date: Fri, 12 Feb 2021 14:46:10 +0000 From: Jonathan Wakely To: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: [committed] libstdc++: Add unused attributes to shared_ptr functions Message-ID: MIME-Version: 1.0 X-Clacks-Overhead: GNU Terry Pratchett X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: multipart/mixed; boundary="/fcYp0eqL4MxuRTC" Content-Disposition: inline X-Spam-Status: No, score=-14.6 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_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libstdc++@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libstdc++ mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Feb 2021 14:46:33 -0000 --/fcYp0eqL4MxuRTC Content-Type: text/plain; charset=us-ascii Content-Disposition: inline This avoids some warnings when building with -fno-rtti because the function parameters are only used when RTTI is enabled. libstdc++-v3/ChangeLog: * include/bits/shared_ptr_base.h (__shared_ptr::_M_get_deleter): Add unused attribute to parameter. * src/c++11/shared_ptr.cc (_Sp_make_shared_tag::_S_eq): Likewise. Tested powerpc64le-linux. Committed to trunk. --/fcYp0eqL4MxuRTC Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="patch.txt" commit 87eaa3c525eb65775e6d77403b83a273a2397099 Author: Jonathan Wakely Date: Fri Feb 12 10:36:18 2021 libstdc++: Add unused attributes to shared_ptr functions This avoids some warnings when building with -fno-rtti because the function parameters are only used when RTTI is enabled. libstdc++-v3/ChangeLog: * include/bits/shared_ptr_base.h (__shared_ptr::_M_get_deleter): Add unused attribute to parameter. * src/c++11/shared_ptr.cc (_Sp_make_shared_tag::_S_eq): Likewise. diff --git a/libstdc++-v3/include/bits/shared_ptr_base.h b/libstdc++-v3/include/bits/shared_ptr_base.h index 15707f8e74a..b24900b2008 100644 --- a/libstdc++-v3/include/bits/shared_ptr_base.h +++ b/libstdc++-v3/include/bits/shared_ptr_base.h @@ -450,7 +450,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION } virtual void* - _M_get_deleter(const std::type_info& __ti) noexcept + _M_get_deleter(const type_info& __ti [[__gnu__::__unused__]]) noexcept { #if __cpp_rtti // _GLIBCXX_RESOLVE_LIB_DEFECTS diff --git a/libstdc++-v3/src/c++11/shared_ptr.cc b/libstdc++-v3/src/c++11/shared_ptr.cc index 13e2d520199..4678fbeffe2 100644 --- a/libstdc++-v3/src/c++11/shared_ptr.cc +++ b/libstdc++-v3/src/c++11/shared_ptr.cc @@ -97,7 +97,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION #endif bool - _Sp_make_shared_tag::_S_eq(const type_info& ti) noexcept + _Sp_make_shared_tag::_S_eq(const type_info& ti [[gnu::unused]]) noexcept { #if __cpp_rtti return ti == typeid(_Sp_make_shared_tag); --/fcYp0eqL4MxuRTC--