From ab44ee7521f924e2eb8caecf103e9e4a4863c732 Mon Sep 17 00:00:00 2001 From: Victor Zverovich Date: Wed, 11 Sep 2024 06:49:02 -0700 Subject: [PATCH] Avoid shadowing --- include/fmt/base.h | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/include/fmt/base.h b/include/fmt/base.h index 75df1746..cc06b9c4 100644 --- a/include/fmt/base.h +++ b/include/fmt/base.h @@ -2936,11 +2936,10 @@ FMT_API void vprintln(FILE* f, string_view fmt, format_args args); */ template FMT_INLINE void print(format_string fmt, T&&... args) { - fmt::vargs vargs = {{args...}}; - if (!FMT_USE_UTF8) - return detail::vprint_mojibake(stdout, fmt.str, vargs, false); - return detail::is_locking() ? vprint_buffered(stdout, fmt.str, vargs) - : vprint(fmt.str, vargs); + vargs va = {{args...}}; + if (!FMT_USE_UTF8) return detail::vprint_mojibake(stdout, fmt.str, va, false); + return detail::is_locking() ? vprint_buffered(stdout, fmt.str, va) + : vprint(fmt.str, va); } /** @@ -2953,19 +2952,19 @@ FMT_INLINE void print(format_string fmt, T&&... args) { */ template FMT_INLINE void print(FILE* f, format_string fmt, T&&... args) { - fmt::vargs vargs = {{args...}}; - if (!FMT_USE_UTF8) return detail::vprint_mojibake(f, fmt.str, vargs, false); - return detail::is_locking() ? vprint_buffered(f, fmt.str, vargs) - : vprint(f, fmt.str, vargs); + vargs va = {{args...}}; + if (!FMT_USE_UTF8) return detail::vprint_mojibake(f, fmt.str, va, false); + return detail::is_locking() ? vprint_buffered(f, fmt.str, va) + : vprint(f, fmt.str, va); } /// Formats `args` according to specifications in `fmt` and writes the output /// to the file `f` followed by a newline. template FMT_INLINE void println(FILE* f, format_string fmt, T&&... args) { - fmt::vargs vargs = {{args...}}; - return FMT_USE_UTF8 ? vprintln(f, fmt.str, vargs) - : detail::vprint_mojibake(f, fmt.str, vargs, true); + vargs va = {{args...}}; + return FMT_USE_UTF8 ? vprintln(f, fmt.str, va) + : detail::vprint_mojibake(f, fmt.str, va, true); } /// Formats `args` according to specifications in `fmt` and writes the output