diff --git a/include/fmt/core.h b/include/fmt/core.h index 21cdadb5..3c71db50 100644 --- a/include/fmt/core.h +++ b/include/fmt/core.h @@ -1938,7 +1938,14 @@ template class basic_format_args { } }; -/** An alias to ``basic_format_args``. */ +#ifdef FMT_ARM_ABI_COMPATIBILITY +/** An alias to ``basic_format_args``. */ +// Separate types would result in shorter symbols but break ABI compatibility +// between clang and gcc on ARM (#1919). +using format_args = basic_format_args; +using wformat_args = basic_format_args; +#else +// DEPRECATED! These are kept for ABI compatibility. // It is a separate type rather than an alias to make symbols readable. struct format_args : basic_format_args { template @@ -1947,6 +1954,7 @@ struct format_args : basic_format_args { struct wformat_args : basic_format_args { using basic_format_args::basic_format_args; }; +#endif namespace detail { @@ -1978,10 +1986,9 @@ inline void vprint_mojibake(std::FILE*, string_view, format_args) {} // vformat_to(...) overload, so SFINAE on iterator type instead. template , bool enable = detail::is_output_iterator::value> -auto vformat_to( - OutputIt out, const S& format_str, - basic_format_args>> args) -> - typename std::enable_if::type { +auto vformat_to(OutputIt out, const S& format_str, + basic_format_args>> args) + -> typename std::enable_if::type { decltype(detail::get_buffer(out)) buf(detail::get_buffer_init(out)); detail::vformat_to(buf, to_string_view(format_str), args); return detail::get_iterator(buf); @@ -2034,8 +2041,8 @@ inline format_to_n_result vformat_to_n( */ template >::value> -inline auto format_to_n(OutputIt out, size_t n, - const S& format_str, const Args&... args) -> +inline auto format_to_n(OutputIt out, size_t n, const S& format_str, + const Args&... args) -> typename std::enable_if>::type { const auto& vargs = fmt::make_args_checked(format_str, args...); return vformat_to_n(out, n, to_string_view(format_str), vargs);