From a6a65cff8da7aa31fa9ad28066bd9e669c9453f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ion=20Gazta=C3=B1aga?= Date: Fri, 1 Aug 2014 11:05:56 +0200 Subject: [PATCH] GitHub #12: Fix MSVC14 warning C4456: declaration of 'x_parent_right' hides previous local declaration --- doc/intrusive.qbk | 7 +++++++ include/boost/intrusive/avltree_algorithms.hpp | 6 +++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/doc/intrusive.qbk b/doc/intrusive.qbk index 6f72da3..913b6dd 100644 --- a/doc/intrusive.qbk +++ b/doc/intrusive.qbk @@ -3761,6 +3761,13 @@ to be inserted in intrusive containers are allocated using `std::vector` or `std [section:release_notes Release Notes] +[section:release_notes_boost_1_57_00 Boost 1.57 Release] + +* Fixed bugs: + * [@https://github.com/boostorg/intrusive/pull/12 GitHub #12: ['Fix MSVC14 warning C4456: declaration of 'x_parent_right' hides previous local declaration]] + +[endsect] + [section:release_notes_boost_1_56_00 Boost 1.56 Release] * Improved Doxygen generated reference and updated and fixed forward-declaration header. diff --git a/include/boost/intrusive/avltree_algorithms.hpp b/include/boost/intrusive/avltree_algorithms.hpp index e6127b8..f63e9ae 100644 --- a/include/boost/intrusive/avltree_algorithms.hpp +++ b/include/boost/intrusive/avltree_algorithms.hpp @@ -411,7 +411,9 @@ class avltree_algorithms static void rebalance_after_erasure(const node_ptr & header, node_ptr x, node_ptr x_parent) { - for (node_ptr root = NodeTraits::get_parent(header); x != root; root = NodeTraits::get_parent(header)) { + for ( node_ptr root = NodeTraits::get_parent(header) + ; x != root + ; root = NodeTraits::get_parent(header), x_parent = NodeTraits::get_parent(x)) { const balance x_parent_balance = NodeTraits::get_balance(x_parent); //Don't cache x_is_leftchild or similar because x can be null and //equal to both x_parent_left and x_parent_right @@ -453,7 +455,6 @@ class avltree_algorithms } else { // x is left child (x_parent_right is the right child) - const node_ptr x_parent_right(NodeTraits::get_right(x_parent)); BOOST_INTRUSIVE_INVARIANT_ASSERT(x_parent_right); if (NodeTraits::get_balance(x_parent_right) == NodeTraits::negative()) { // x_parent_right MUST have then a left child @@ -473,7 +474,6 @@ class avltree_algorithms else{ BOOST_INTRUSIVE_INVARIANT_ASSERT(false); // never reached } - x_parent = NodeTraits::get_parent(x); } }