From: Jonathan Wakely Date: Tue, 3 Jun 2014 17:58:51 +0000 (+0100) Subject: backport: re PR libstdc++/60734 (Undefined behavior in g++-v4/bits/stl_tree.h) X-Git-Tag: releases/gcc-4.8.4~433 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a3b30fb61d1696d3e95b2ec1018009d629a280d5;p=thirdparty%2Fgcc.git backport: re PR libstdc++/60734 (Undefined behavior in g++-v4/bits/stl_tree.h) Backport from mainline 2014-04-15 Jonathan Wakely PR libstdc++/60734 * include/bits/stl_tree.h (_Rb_tree::_M_end): Fix invalid cast. From-SVN: r211197 --- diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 0c11cf26f38a..4736ae490143 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,11 @@ +2014-06-03 Jonathan Wakely + + Backport from mainline + 2014-04-15 Jonathan Wakely + + PR libstdc++/60734 + * include/bits/stl_tree.h (_Rb_tree::_M_end): Fix invalid cast. + 2014-05-29 Jonathan Wakely * include/tr2/bool_set: Use UTF-8 for accented characters. diff --git a/libstdc++-v3/include/bits/stl_tree.h b/libstdc++-v3/include/bits/stl_tree.h index 91bf4df45114..a9bd3d6fe6fb 100644 --- a/libstdc++-v3/include/bits/stl_tree.h +++ b/libstdc++-v3/include/bits/stl_tree.h @@ -510,11 +510,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION _Link_type _M_end() - { return static_cast<_Link_type>(&this->_M_impl._M_header); } + { return reinterpret_cast<_Link_type>(&this->_M_impl._M_header); } _Const_Link_type _M_end() const - { return static_cast<_Const_Link_type>(&this->_M_impl._M_header); } + { return reinterpret_cast<_Const_Link_type>(&this->_M_impl._M_header); } static const_reference _S_value(_Const_Link_type __x)