aboutsummaryrefslogtreecommitdiff
path: root/libstdc++-v3/include
diff options
context:
space:
mode:
authorJonathan Wakely <jwakely@redhat.com>2016-10-10 12:44:05 +0100
committerJonathan Wakely <redi@gcc.gnu.org>2016-10-10 12:44:05 +0100
commit208b8b69b660382eed5b1550f0ee945c614a6bb4 (patch)
tree46f9c2a44c23b9d98e738c2cf06ffeacbd6b5012 /libstdc++-v3/include
parent30102051a53033464e4eff65fcfb7aafd45e9f1a (diff)
downloadgcc-208b8b69b660382eed5b1550f0ee945c614a6bb4.zip
gcc-208b8b69b660382eed5b1550f0ee945c614a6bb4.tar.gz
gcc-208b8b69b660382eed5b1550f0ee945c614a6bb4.tar.bz2
Add noexcept to enable_shared_from_this::weak_from_this
* include/bits/shared_ptr.h (enable_shared_from_this::weak_from_this): Add noexcept. * include/bits/shared_ptr_base.h (__enable_shared_from_this::weak_from_this): Likewise. * testsuite/20_util/enable_shared_from_this/members/weak_from_this.cc: Test exception-specification of weak_from_this. From-SVN: r240917
Diffstat (limited to 'libstdc++-v3/include')
-rw-r--r--libstdc++-v3/include/bits/shared_ptr.h4
-rw-r--r--libstdc++-v3/include/bits/shared_ptr_base.h4
2 files changed, 4 insertions, 4 deletions
diff --git a/libstdc++-v3/include/bits/shared_ptr.h b/libstdc++-v3/include/bits/shared_ptr.h
index b2523b8..cbcb3b3 100644
--- a/libstdc++-v3/include/bits/shared_ptr.h
+++ b/libstdc++-v3/include/bits/shared_ptr.h
@@ -593,11 +593,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
#if __cplusplus > 201402L || !defined(__STRICT_ANSI__) // c++1z or gnu++11
#define __cpp_lib_enable_shared_from_this 201603
weak_ptr<_Tp>
- weak_from_this()
+ weak_from_this() noexcept
{ return this->_M_weak_this; }
weak_ptr<const _Tp>
- weak_from_this() const
+ weak_from_this() const noexcept
{ return this->_M_weak_this; }
#endif
diff --git a/libstdc++-v3/include/bits/shared_ptr_base.h b/libstdc++-v3/include/bits/shared_ptr_base.h
index 4ae2668..e8820a1 100644
--- a/libstdc++-v3/include/bits/shared_ptr_base.h
+++ b/libstdc++-v3/include/bits/shared_ptr_base.h
@@ -1562,11 +1562,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
#if __cplusplus > 201402L || !defined(__STRICT_ANSI__) // c++1z or gnu++11
__weak_ptr<_Tp, _Lp>
- weak_from_this()
+ weak_from_this() noexcept
{ return this->_M_weak_this; }
__weak_ptr<const _Tp, _Lp>
- weak_from_this() const
+ weak_from_this() const noexcept
{ return this->_M_weak_this; }
#endif