diff options
author | Jonathan Wakely <jwakely@redhat.com> | 2015-09-07 18:17:23 +0100 |
---|---|---|
committer | Jonathan Wakely <redi@gcc.gnu.org> | 2015-09-07 18:17:23 +0100 |
commit | 93023f35f7d9a6ccbc6bb121fb5b95171678924b (patch) | |
tree | 9a49af7dda8df248be428236f31507ef30b429f6 /libstdc++-v3/include | |
parent | b11e7db7139c3e231d49611b9f0415d6f1333a69 (diff) | |
download | gcc-93023f35f7d9a6ccbc6bb121fb5b95171678924b.zip gcc-93023f35f7d9a6ccbc6bb121fb5b95171678924b.tar.gz gcc-93023f35f7d9a6ccbc6bb121fb5b95171678924b.tar.bz2 |
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
Diffstat (limited to 'libstdc++-v3/include')
-rw-r--r-- | libstdc++-v3/include/bits/shared_ptr_base.h | 2 | ||||
-rw-r--r-- | libstdc++-v3/include/bits/unique_ptr.h | 2 |
2 files changed, 2 insertions, 2 deletions
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(); } |