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); }