aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2020-10-26 10:11:50 +0000
committerJonathan Wakely <jwakely@redhat.com>2020-10-26 10:15:45 +0000
commitdc7824734e6589bac2ba0f8363d24d50da8cfeae (patch)
treef3d78cad5943d98effe12acd227688bfb769b7d1
parent02a8253980d04638085237915498acd04297fbbf (diff)
downloadgcc-dc7824734e6589bac2ba0f8363d24d50da8cfeae.zip
gcc-dc7824734e6589bac2ba0f8363d24d50da8cfeae.tar.gz
gcc-dc7824734e6589bac2ba0f8363d24d50da8cfeae.tar.bz2
libstdc++: Add missing exception-specifications in shared_ptr
libstdc++-v3/ChangeLog: * include/bits/shared_ptr_base.h (_Sp_counted_base::_M_add_ref_lock_nothrow(): Add noexcept to definitions to match declaration. (__shared_count(const __weak_count&, nothrow_t)): Add noexcept to declaration to match definition.
-rw-r--r--libstdc++-v3/include/bits/shared_ptr_base.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/libstdc++-v3/include/bits/shared_ptr_base.h b/libstdc++-v3/include/bits/shared_ptr_base.h
index a9e1c9b..543783b 100644
--- a/libstdc++-v3/include/bits/shared_ptr_base.h
+++ b/libstdc++-v3/include/bits/shared_ptr_base.h
@@ -227,7 +227,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
template<>
inline bool
_Sp_counted_base<_S_single>::
- _M_add_ref_lock_nothrow()
+ _M_add_ref_lock_nothrow() noexcept
{
if (_M_use_count == 0)
return false;
@@ -238,7 +238,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
template<>
inline bool
_Sp_counted_base<_S_mutex>::
- _M_add_ref_lock_nothrow()
+ _M_add_ref_lock_nothrow() noexcept
{
__gnu_cxx::__scoped_lock sentry(*this);
if (__gnu_cxx::__exchange_and_add_dispatch(&_M_use_count, 1) == 0)
@@ -252,7 +252,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
template<>
inline bool
_Sp_counted_base<_S_atomic>::
- _M_add_ref_lock_nothrow()
+ _M_add_ref_lock_nothrow() noexcept
{
// Perform lock-free add-if-not-zero operation.
_Atomic_word __count = _M_get_use_count();
@@ -693,7 +693,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
explicit __shared_count(const __weak_count<_Lp>& __r);
// Does not throw if __r._M_get_use_count() == 0, caller must check.
- explicit __shared_count(const __weak_count<_Lp>& __r, std::nothrow_t);
+ explicit
+ __shared_count(const __weak_count<_Lp>& __r, std::nothrow_t) noexcept;
~__shared_count() noexcept
{