From c3fa33314045cb4a132eef9a94524fb073a1e696 Mon Sep 17 00:00:00 2001 From: Johan Norberg Date: Sat, 11 Apr 2020 20:16:45 +0200 Subject: [PATCH] Remove warning in core.h with when compiling with gcc and -Wshadow MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In file included from build/_deps/fmt-src/include/fmt/format.h:44:0, from src/main.cpp:5: build/_deps/fmt-src/include/fmt/core.h: In member function ‘const T& fmt::v6::internal::dynamic_arg_list::push(const Arg&)’: build/_deps/fmt-src/include/fmt/core.h:1256:10: error: declaration of ‘node’ shadows a member of ‘fmt::v6::internal::dynamic_arg_list’ [-Werror=shadow] auto node = std::unique_ptr>(new typed_node(arg)); ^~~~ build/_deps/fmt-src/include/fmt/core.h:1236:37: note: shadowed declaration is here template struct node { --- include/fmt/core.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/fmt/core.h b/include/fmt/core.h index 359916ce..56f1079d 100644 --- a/include/fmt/core.h +++ b/include/fmt/core.h @@ -1288,10 +1288,10 @@ class dynamic_arg_list { public: template const T& push(const Arg& arg) { - auto node = std::unique_ptr>(new typed_node(arg)); - auto& value = node->value; - node->next = std::move(head_); - head_ = std::move(node); + auto new_node = std::unique_ptr>(new typed_node(arg)); + auto& value = new_node->value; + new_node->next = std::move(head_); + head_ = std::move(new_node); return value; } };