From bfc0924eacaa3c6163eb872c8948098565464192 Mon Sep 17 00:00:00 2001 From: Kenny Weiss Date: Fri, 13 Jan 2023 11:36:00 -0800 Subject: [PATCH] Bugfix for fmt::printf on Power9 architecture with the XL compiler (#3256) --- include/fmt/printf.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/include/fmt/printf.h b/include/fmt/printf.h index f091cc80..cae051d7 100644 --- a/include/fmt/printf.h +++ b/include/fmt/printf.h @@ -218,6 +218,14 @@ template class printf_width_handler { } }; +// Workaround for a bug with the XL compiler when initializing +// printf_arg_formatter's base class. +template +auto make_arg_formatter(buffer_appender iter, format_specs& s) + -> arg_formatter { + return {iter, s, locale_ref()}; +} + // The ``printf`` argument formatter. template class printf_arg_formatter : public arg_formatter { @@ -235,7 +243,7 @@ class printf_arg_formatter : public arg_formatter { public: printf_arg_formatter(OutputIt iter, format_specs& s, context_type& ctx) - : base{iter, s, locale_ref()}, context_(ctx) {} + : base(make_arg_formatter(iter, s)), context_(ctx) {} OutputIt operator()(monostate value) { return base::operator()(value); }