From 5f97d5d66f65197417c80de8d10487c6ad96aff1 Mon Sep 17 00:00:00 2001 From: Arseny Kapoulkine Date: Wed, 25 Nov 2020 09:28:26 -0800 Subject: [PATCH] Fix -Wshadow in remove_children() child variable was shadowing xml_node::child --- src/pugixml.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/pugixml.cpp b/src/pugixml.cpp index a74b118..e9a6944 100644 --- a/src/pugixml.cpp +++ b/src/pugixml.cpp @@ -6142,13 +6142,13 @@ namespace pugi impl::xml_allocator& alloc = impl::get_allocator(_root); if (!alloc.reserve()) return false; - for (xml_node_struct* child = _root->first_child; child; ) + for (xml_node_struct* cur = _root->first_child; cur; ) { - xml_node_struct* next = child->next_sibling; + xml_node_struct* next = cur->next_sibling; - impl::destroy_node(child, alloc); + impl::destroy_node(cur, alloc); - child = next; + cur = next; } _root->first_child = 0;