From 84898b4626a09b2a08daa2523775aa7fa5631373 Mon Sep 17 00:00:00 2001 From: Johan Norberg Date: Sat, 11 Apr 2020 20:15:24 +0200 Subject: [PATCH] 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 1a192cca..1e2d7d6c 100644 --- a/include/fmt/format.h +++ b/include/fmt/format.h @@ -3222,9 +3222,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 w(range_type(ctx.out())); + w.write_bytes(b.data_, specs_); + return w.out(); } private: