summaryrefslogtreecommitdiff
path: root/libstdc++-v3
diff options
context:
space:
mode:
authorJonathan Wakely <jwakely@redhat.com>2016-12-06 14:36:00 +0000
committerJonathan Wakely <redi@gcc.gnu.org>2016-12-06 14:36:00 +0000
commit55037a694f63196eb28dc7eb0cab0857fe7ab85c (patch)
tree98616d424d81e587e56791770c207a090199106a /libstdc++-v3
parentfb7b736cbbeebcd61997a83b6715c4fed29375cf (diff)
downloadgcc-55037a694f63196eb28dc7eb0cab0857fe7ab85c.tar.gz
Fix debug mode assertion for std::shared_ptr<void>
* include/bits/shared_ptr_base.h (__shared_ptr_access<T, L, false, true>::operator->()): Fix assertion. From-SVN: r243303
Diffstat (limited to 'libstdc++-v3')
-rw-r--r--libstdc++-v3/ChangeLog5
-rw-r--r--libstdc++-v3/include/bits/shared_ptr_base.h5
2 files changed, 8 insertions, 2 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index b8edb7b2412..676d32b2722 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -1,3 +1,8 @@
+2016-12-06 Jonathan Wakely <jwakely@redhat.com>
+
+ * include/bits/shared_ptr_base.h
+ (__shared_ptr_access<T, L, false, true>::operator->()): Fix assertion.
+
2016-12-06 Ville Voutilainen <ville.voutilainen@gmail.com>
Constrain optional's __constexpr_addressof in its return type
diff --git a/libstdc++-v3/include/bits/shared_ptr_base.h b/libstdc++-v3/include/bits/shared_ptr_base.h
index 2fb70b7a5cb..7e02043ed12 100644
--- a/libstdc++-v3/include/bits/shared_ptr_base.h
+++ b/libstdc++-v3/include/bits/shared_ptr_base.h
@@ -983,8 +983,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
element_type*
operator->() const noexcept
{
- _GLIBCXX_DEBUG_PEDASSERT(_M_get() != nullptr);
- return static_cast<const __shared_ptr<_Tp, _Lp>*>(this)->get();
+ auto __ptr = static_cast<const __shared_ptr<_Tp, _Lp>*>(this)->get();
+ _GLIBCXX_DEBUG_PEDASSERT(__ptr != nullptr);
+ return __ptr;
}
};