From 9505bdd852b023985275748be34539c3e932def8 Mon Sep 17 00:00:00 2001 From: Johan Norberg Date: Sat, 11 Apr 2020 20:15:24 +0200 Subject: [PATCH 1/2] Remove warning in format.h when compiling with gcc and -Wshadow MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit build/_deps/fmt-src/include/fmt/format.h: In member function ‘decltype (ctx.out()) fmt::v6::formatter::format(fmt::v6::bytes, FormatContext&)’: build/_deps/fmt-src/include/fmt/format.h:3251:58: error: declaration of ‘writer’ shadows a global declaration [-Werror=shadow] internal::basic_writer writer(range_type(ctx.out())); ^~~ build/_deps/fmt-src/include/fmt/format.h:2741:53: note: shadowed declaration is here using writer FMT_DEPRECATED_ALIAS = internal::writer; --- include/fmt/format.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/fmt/format.h b/include/fmt/format.h index 3b1ebe59b252..ca45906dd0b3 100644 --- a/include/fmt/format.h +++ b/include/fmt/format.h @@ -3248,9 +3248,9 @@ template <> struct formatter { specs_.precision, specs_.precision_ref, ctx); using range_type = internal::output_range; - internal::basic_writer writer(range_type(ctx.out())); - writer.write_bytes(b.data_, specs_); - return writer.out(); + internal::basic_writer writer_(range_type(ctx.out())); + writer_.write_bytes(b.data_, specs_); + return writer_.out(); } private: From f660d920337e1b641e7b5bf150f9752b52615fed Mon Sep 17 00:00:00 2001 From: Johan Norberg Date: Sat, 11 Apr 2020 20:16:45 +0200 Subject: [PATCH 2/2] 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 cab3dfe0b772..9df1020df143 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; } };