From 4b3f98299462007a9bb8cdd349c2d59bee0eaf44 Mon Sep 17 00:00:00 2001 From: Jonathan Wakely Date: Tue, 15 Apr 2014 11:52:06 +0100 Subject: [PATCH] re PR libstdc++/60734 (Undefined behavior in g++-v4/bits/stl_tree.h) PR libstdc++/60734 * include/bits/stl_tree.h (_Rb_tree::_M_end): Fix invalid cast. From-SVN: r209414 --- libstdc++-v3/ChangeLog | 5 +++++ libstdc++-v3/include/bits/stl_tree.h | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 54ec30e00325..e11f1a9e8711 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,8 @@ +2014-04-15 Jonathan Wakely + + PR libstdc++/60734 + * include/bits/stl_tree.h (_Rb_tree::_M_end): Fix invalid cast. + 2014-04-14 Jonathan Wakely * include/bits/stl_vector.h (_Vector_base::_Vector_impl, diff --git a/libstdc++-v3/include/bits/stl_tree.h b/libstdc++-v3/include/bits/stl_tree.h index 4bc3c602c200..288c9fa4f1e4 100644 --- a/libstdc++-v3/include/bits/stl_tree.h +++ b/libstdc++-v3/include/bits/stl_tree.h @@ -526,11 +526,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION _Link_type _M_end() _GLIBCXX_NOEXCEPT - { 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 _GLIBCXX_NOEXCEPT - { 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)