From f660d920337e1b641e7b5bf150f9752b52615fed 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 cab3dfe0..9df1020d 100644 --- a/include/fmt/core.h +++ b/include/fmt/core.h @@ -1253,10 +1253,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 node_ = std::unique_ptr>(new typed_node(arg)); + auto& value = node_->value; + node_->next = std::move(head_); + head_ = std::move(node_); return value; } };