* 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
2015-09-07 Jonathan Wakely <jwakely@redhat.com>
+ * 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.
+
* include/bits/regex_compiler.h (_BracketMatcher::_M_is_ready):
Initialize using NSDMI and set using _GLIBCXX_DEBUG_ONLY.
_Tp*
operator->() const noexcept
{
- _GLIBCXX_DEBUG_ASSERT(_M_ptr != 0);
+ _GLIBCXX_DEBUG_PEDASSERT(_M_ptr != 0);
return _M_ptr;
}
pointer
operator->() const noexcept
{
- _GLIBCXX_DEBUG_ASSERT(get() != pointer());
+ _GLIBCXX_DEBUG_PEDASSERT(get() != pointer());
return get();
}
VERIFY( &p->i == &a->i );
}
+void
+test04()
+{
+ bool test __attribute__((unused)) = true;
+
+#if !(defined _GLIBCXX_DEBUG && defined _GLIBCXX_DEBUG_PEDANTIC)
+ std::shared_ptr<int> p;
+ auto np = p.operator->();
+ VERIFY( np == nullptr );
+#endif
+}
+
int
main()
{
test01();
test02();
test03();
+ test04();
return 0;
}