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 CADF23858436 for ; Tue, 5 Oct 2021 08:38:35 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org CADF23858436 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-515-33Yh69d7Pjm9csPQ4IV1Zw-1; Tue, 05 Oct 2021 04:38:34 -0400 X-MC-Unique: 33Yh69d7Pjm9csPQ4IV1Zw-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 4CC7083DBC9; Tue, 5 Oct 2021 08:38:33 +0000 (UTC) Received: from localhost (unknown [10.33.37.40]) by smtp.corp.redhat.com (Postfix) with ESMTP id D0E285D9F4; Tue, 5 Oct 2021 08:38:32 +0000 (UTC) Date: Tue, 5 Oct 2021 09:38:31 +0100 From: Jonathan Wakely To: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: [committed] libstdc++: Add noexcept to some std::function internals Message-ID: MIME-Version: 1.0 X-Clacks-Overhead: GNU Terry Pratchett X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: multipart/mixed; boundary="5iBycpn8DuhjB6nu" Content-Disposition: inline X-Spam-Status: No, score=-13.8 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_H2, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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: Tue, 05 Oct 2021 08:38:36 -0000 --5iBycpn8DuhjB6nu Content-Type: text/plain; charset=us-ascii Content-Disposition: inline libstdc++-v3/ChangeLog: * include/bits/std_function.h (_Any_data::_M_access): Add noexcept. (_Function_base::_Base_manager::_M_get_pointer): Likewise. (_Function_base::_Base_manager::_M_not_empty_function): Likewise. Tested powerpc64le-linux. Committed to trunk. --5iBycpn8DuhjB6nu Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="patch.txt" commit 9665c2e76849c8e0066c6660779ae082fce67ea8 Author: Jonathan Wakely Date: Mon Oct 4 15:22:58 2021 libstdc++: Add noexcept to some std::function internals libstdc++-v3/ChangeLog: * include/bits/std_function.h (_Any_data::_M_access): Add noexcept. (_Function_base::_Base_manager::_M_get_pointer): Likewise. (_Function_base::_Base_manager::_M_not_empty_function): Likewise. diff --git a/libstdc++-v3/include/bits/std_function.h b/libstdc++-v3/include/bits/std_function.h index 3dda820bd1a..55738440949 100644 --- a/libstdc++-v3/include/bits/std_function.h +++ b/libstdc++-v3/include/bits/std_function.h @@ -82,17 +82,17 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION union [[gnu::may_alias]] _Any_data { - void* _M_access() { return &_M_pod_data[0]; } - const void* _M_access() const { return &_M_pod_data[0]; } + void* _M_access() noexcept { return &_M_pod_data[0]; } + const void* _M_access() const noexcept { return &_M_pod_data[0]; } template _Tp& - _M_access() + _M_access() noexcept { return *static_cast<_Tp*>(_M_access()); } template const _Tp& - _M_access() const + _M_access() const noexcept { return *static_cast(_M_access()); } _Nocopy_types _M_unused; @@ -131,7 +131,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION // Retrieve a pointer to the function object static _Functor* - _M_get_pointer(const _Any_data& __source) + _M_get_pointer(const _Any_data& __source) noexcept { if _GLIBCXX17_CONSTEXPR (__stored_locally) { @@ -217,22 +217,22 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION template static bool - _M_not_empty_function(const function<_Signature>& __f) + _M_not_empty_function(const function<_Signature>& __f) noexcept { return static_cast(__f); } template static bool - _M_not_empty_function(_Tp* __fp) + _M_not_empty_function(_Tp* __fp) noexcept { return __fp != nullptr; } template static bool - _M_not_empty_function(_Tp _Class::* __mp) + _M_not_empty_function(_Tp _Class::* __mp) noexcept { return __mp != nullptr; } template static bool - _M_not_empty_function(const _Tp&) + _M_not_empty_function(const _Tp&) noexcept { return true; } }; --5iBycpn8DuhjB6nu--