[patch] Relax Debug Mode assertions on operator-> for smart pointers.

Jonathan Wakely jwakely@redhat.com
Mon Sep 7 17:17:00 GMT 2015


The standard says that unique_ptr::operator->() and
shared_ptr::operator->() have preconditions that the pointer is not
null, but that's not strictly necessary and prevents using that
function to get a raw pointer from a smart pointer in generic code.

This changes the _GLIBCXX_DEBUG_ASSERT to _GLIBCXX_DEBUG_PEDASSERT so
they only fire in pedantic debug mode.

Tested powerpc64le-linux, committed to trunk.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.txt
Type: text/x-patch
Size: 2064 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20150907/6c184cb8/attachment.bin>


More information about the Libstdc++ mailing list