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 + + * include/bits/shared_ptr_base.h + (__shared_ptr_access::operator->()): Fix assertion. + 2016-12-06 Ville Voutilainen 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*>(this)->get(); + auto __ptr = static_cast*>(this)->get(); + _GLIBCXX_DEBUG_PEDASSERT(__ptr != nullptr); + return __ptr; } };