[patch] Make std::forward_list safe against overloaded operator&

Jonathan Wakely jwakely@redhat.com
Wed Jun 17 12:24:00 GMT 2015


Similar to yesterday's patch for std::list.

Also removes some invalid downcasts of the _Node_base sentinel's
address to _Node*. The casts aren't needed anyway, as we only access
members of the base class through those pointers.

Also removes some redundant upcasts using *static_cast<Base*>(&x)
which will fail if there's an operator& overload associated with Base.
We can just rely on the implicit conversion to Base& instead.

Tested powerpc64le-linux, committed to trunk.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.txt
Type: text/x-patch
Size: 7300 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20150617/f5aaf89e/attachment.bin>


More information about the Gcc-patches mailing list