Skip to content

Commit

Permalink
Bugfix to fmt@9.1 for XL compiler
Browse files Browse the repository at this point in the history
Upstreamed to fmt: fmtlib/fmt#3256
  • Loading branch information
kennyweiss committed Jan 3, 2023
1 parent d2c6107 commit b949135
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 1 deletion.
8 changes: 8 additions & 0 deletions src/thirdparty/axom/fmt/format.h
Original file line number Diff line number Diff line change
Expand Up @@ -3389,6 +3389,14 @@ template <typename Char> struct arg_formatter {
const basic_format_specs<Char>& specs;
locale_ref locale;

// BEGIN AXOM BUGFIX
arg_formatter(buffer_appender<Char> it, const basic_format_specs<Char>& s)
: out (it), specs (s) {}

arg_formatter(buffer_appender<Char> it, const basic_format_specs<Char>& s, locale_ref l)
: out (it), specs (s), locale (l) {}
// END AXOM BUGFIX

template <typename T>
AXOM_FMT_CONSTEXPR AXOM_FMT_INLINE auto operator()(T value) -> iterator {
return detail::write(out, value, specs, locale);
Expand Down
4 changes: 3 additions & 1 deletion src/thirdparty/axom/fmt/printf.h
Original file line number Diff line number Diff line change
Expand Up @@ -237,8 +237,10 @@ class printf_arg_formatter : public arg_formatter<Char> {
}

public:
// BEGIN AXOM BUGFIX
printf_arg_formatter(OutputIt iter, format_specs& s, context_type& ctx)
: base{iter, s, locale_ref()}, context_(ctx) {}
: base{iter, s}, context_(ctx) {}
// END AXOM BUGFIX

OutputIt operator()(monostate value) { return base::operator()(value); }

Expand Down
35 changes: 35 additions & 0 deletions src/thirdparty/axom/fmt/xl_clang.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
diff --git a/src/thirdparty/axom/fmt/format.h b/src/thirdparty/axom/fmt/format.h
index 309b7d098..047bf255e 100644
--- a/src/thirdparty/axom/fmt/format.h
+++ b/src/thirdparty/axom/fmt/format.h
@@ -3389,6 +3389,14 @@ template <typename Char> struct arg_formatter {
const basic_format_specs<Char>& specs;
locale_ref locale;

+ // BEGIN AXOM BUGFIX
+ arg_formatter(buffer_appender<Char> it, const basic_format_specs<Char>& s)
+ : out (it), specs (s) {}
+
+ arg_formatter(buffer_appender<Char> it, const basic_format_specs<Char>& s, locale_ref l)
+ : out (it), specs (s), locale (l) {}
+ // END AXOM BUGFIX
+
template <typename T>
AXOM_FMT_CONSTEXPR AXOM_FMT_INLINE auto operator()(T value) -> iterator {
return detail::write(out, value, specs, locale);
diff --git a/src/thirdparty/axom/fmt/printf.h b/src/thirdparty/axom/fmt/printf.h
index 1c6f960a6..0ee1f30f3 100644
--- a/src/thirdparty/axom/fmt/printf.h
+++ b/src/thirdparty/axom/fmt/printf.h
@@ -237,8 +237,10 @@ class printf_arg_formatter : public arg_formatter<Char> {
}

public:
+ // BEGIN AXOM BUGFIX
printf_arg_formatter(OutputIt iter, format_specs& s, context_type& ctx)
- : base{iter, s, locale_ref()}, context_(ctx) {}
+ : base{iter, s}, context_(ctx) {}
+ // END AXOM BUGFIX

OutputIt operator()(monostate value) { return base::operator()(value); }

0 comments on commit b949135

Please sign in to comment.