From e4645d2867f01667d619885de59940233d834874 Mon Sep 17 00:00:00 2001 From: Kenneth Weiss Date: Mon, 9 Jan 2023 12:35:05 -0800 Subject: [PATCH] Apply XL compiler bugfix within printf_arg_formatter constructor --- include/fmt/printf.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/include/fmt/printf.h b/include/fmt/printf.h index 409e0b1faeca..8eecf0b44c5f 100644 --- a/include/fmt/printf.h +++ b/include/fmt/printf.h @@ -235,7 +235,13 @@ class printf_arg_formatter : public arg_formatter { public: printf_arg_formatter(OutputIt iter, format_specs* s, context_type& ctx) - : base{iter, s}, context_(ctx) {} + : base{iter, s, locale_ref()}, context_(ctx) { +#if defined(__ibmxl__) + // Bugfix: XL compiler optimizes out initializer for base + this->out = iter; + this->specs = s; +#endif + } OutputIt operator()(monostate value) { return base::operator()(value); }