From 93023f35f7d9a6ccbc6bb121fb5b95171678924b Mon Sep 17 00:00:00 2001 From: Jonathan Wakely Date: Mon, 7 Sep 2015 18:17:23 +0100 Subject: Relax Debug Mode assertions on operator-> for smart pointers. * include/bits/shared_ptr_base.h (__shared_ptr::operator->): Change _GLIBCXX_DEBUG_ASSERT to _GLIBCXX_DEBUG_PEDASSERT. * include/bits/unique_ptr.h (unique_ptr::operator->): Likewise. * testsuite/20_util/shared_ptr/observers/get.cc: Test operator-> on empty shared_ptr. From-SVN: r227524 --- libstdc++-v3/include/bits/shared_ptr_base.h | 2 +- libstdc++-v3/include/bits/unique_ptr.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'libstdc++-v3/include') diff --git a/libstdc++-v3/include/bits/shared_ptr_base.h b/libstdc++-v3/include/bits/shared_ptr_base.h index f2f577b..75f1a0d 100644 --- a/libstdc++-v3/include/bits/shared_ptr_base.h +++ b/libstdc++-v3/include/bits/shared_ptr_base.h @@ -1054,7 +1054,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION _Tp* operator->() const noexcept { - _GLIBCXX_DEBUG_ASSERT(_M_ptr != 0); + _GLIBCXX_DEBUG_PEDASSERT(_M_ptr != 0); return _M_ptr; } diff --git a/libstdc++-v3/include/bits/unique_ptr.h b/libstdc++-v3/include/bits/unique_ptr.h index 8ab55da..bb96951 100644 --- a/libstdc++-v3/include/bits/unique_ptr.h +++ b/libstdc++-v3/include/bits/unique_ptr.h @@ -295,7 +295,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION pointer operator->() const noexcept { - _GLIBCXX_DEBUG_ASSERT(get() != pointer()); + _GLIBCXX_DEBUG_PEDASSERT(get() != pointer()); return get(); } -- cgit v1.1