public inbox for libstdc++@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jonathan Wakely <jwakely@redhat.com>
To: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org
Subject: [committed] libstdc++: Add noexcept to some std::function internals
Date: Tue, 5 Oct 2021 09:38:31 +0100	[thread overview]
Message-ID: <YVwPB9n2mj7GdoNH@redhat.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 271 bytes --]

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.


[-- Attachment #2: patch.txt --]
[-- Type: text/plain, Size: 2471 bytes --]

commit 9665c2e76849c8e0066c6660779ae082fce67ea8
Author: Jonathan Wakely <jwakely@redhat.com>
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<typename _Tp>
       _Tp&
-      _M_access()
+      _M_access() noexcept
       { return *static_cast<_Tp*>(_M_access()); }
 
     template<typename _Tp>
       const _Tp&
-      _M_access() const
+      _M_access() const noexcept
       { return *static_cast<const _Tp*>(_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<typename _Signature>
 	  static bool
-	  _M_not_empty_function(const function<_Signature>& __f)
+	  _M_not_empty_function(const function<_Signature>& __f) noexcept
 	  { return static_cast<bool>(__f); }
 
 	template<typename _Tp>
 	  static bool
-	  _M_not_empty_function(_Tp* __fp)
+	  _M_not_empty_function(_Tp* __fp) noexcept
 	  { return __fp != nullptr; }
 
 	template<typename _Class, typename _Tp>
 	  static bool
-	  _M_not_empty_function(_Tp _Class::* __mp)
+	  _M_not_empty_function(_Tp _Class::* __mp) noexcept
 	  { return __mp != nullptr; }
 
 	template<typename _Tp>
 	  static bool
-	  _M_not_empty_function(const _Tp&)
+	  _M_not_empty_function(const _Tp&) noexcept
 	  { return true; }
       };
 

                 reply	other threads:[~2021-10-05  8:38 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YVwPB9n2mj7GdoNH@redhat.com \
    --to=jwakely@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=libstdc++@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).