diff --git a/include/fmt/color.h b/include/fmt/color.h index 7fa5490e44dc..3d5490e87f40 100644 --- a/include/fmt/color.h +++ b/include/fmt/color.h @@ -507,7 +507,7 @@ void vformat_to(buffer& buf, const text_style& ts, auto background = detail::make_background_color(ts.get_background()); buf.append(background.begin(), background.end()); } - detail::vformat_to(buf, format_str, args); + detail::vformat_to(buf, format_str, args, {}); if (has_style) detail::reset_color(buf); } diff --git a/include/fmt/core.h b/include/fmt/core.h index 22768ff8c595..2545137c1d42 100644 --- a/include/fmt/core.h +++ b/include/fmt/core.h @@ -2734,7 +2734,7 @@ template void vformat_to( buffer& buf, basic_string_view fmt, basic_format_args)> args, - detail::locale_ref loc = {}); + locale_ref loc = {}); FMT_API void vprint_mojibake(std::FILE*, string_view, format_args); #ifndef _WIN32 @@ -2892,7 +2892,7 @@ template OutputIt { using detail::get_buffer; auto&& buf = get_buffer(out); - detail::vformat_to(buf, string_view(fmt), args); + detail::vformat_to(buf, string_view(fmt), args, {}); return detail::get_iterator(buf); } @@ -2929,7 +2929,7 @@ auto vformat_to_n(OutputIt out, size_t n, string_view fmt, format_args args) using buffer = detail::iterator_buffer; auto buf = buffer(out, n); - detail::vformat_to(buf, fmt, args); + detail::vformat_to(buf, fmt, args, {}); return {buf.out(), buf.count()}; } @@ -2951,7 +2951,7 @@ FMT_INLINE auto format_to_n(OutputIt out, size_t n, format_string fmt, template FMT_INLINE auto formatted_size(format_string fmt, T&&... args) -> size_t { auto buf = detail::counting_buffer<>(); - detail::vformat_to(buf, string_view(fmt), fmt::make_format_args(args...)); + detail::vformat_to(buf, string_view(fmt), fmt::make_format_args(args...), {}); return buf.count(); } diff --git a/include/fmt/format.h b/include/fmt/format.h index 0024cf7cea65..5398a23a82a9 100644 --- a/include/fmt/format.h +++ b/include/fmt/format.h @@ -2624,9 +2624,10 @@ auto to_string(const basic_memory_buffer& buf) FMT_BEGIN_DETAIL_NAMESPACE template -void vformat_to(buffer& buf, basic_string_view fmt, - basic_format_args>> args, - locale_ref loc) { +void vformat_to( + buffer& buf, basic_string_view fmt, + basic_format_args)> args, + locale_ref loc) { // workaround for msvc bug regarding name-lookup in module // link names into function scope using detail::arg_formatter; @@ -2706,10 +2707,6 @@ void vformat_to(buffer& buf, basic_string_view fmt, } #ifndef FMT_HEADER_ONLY -extern template void vformat_to(detail::buffer&, string_view, - basic_format_args, - detail::locale_ref); - extern template FMT_API auto thousands_sep_impl(locale_ref) -> thousands_sep_result; extern template FMT_API auto thousands_sep_impl(locale_ref) diff --git a/include/fmt/xchar.h b/include/fmt/xchar.h index 74c690458fde..a0dd032f1666 100644 --- a/include/fmt/xchar.h +++ b/include/fmt/xchar.h @@ -142,7 +142,7 @@ FMT_DEPRECATED auto format_to(basic_memory_buffer& buf, const S& format_str, Args&&... args) -> typename buffer_context::iterator { const auto& vargs = fmt::make_args_checked(format_str, args...); - detail::vformat_to(buf, to_string_view(format_str), vargs); + detail::vformat_to(buf, to_string_view(format_str), vargs, {}); return detail::buffer_appender(buf); } diff --git a/src/format.cc b/src/format.cc index 187dcb739043..66925b421052 100644 --- a/src/format.cc +++ b/src/format.cc @@ -47,6 +47,9 @@ template FMT_API char detail::decimal_point_impl(locale_ref); template FMT_API void detail::buffer::append(const char*, const char*); +// DEPRECATED! +// There is no correspondent extern template in format.h because of +// incompatibility between clang and gcc (#2377). template FMT_API void detail::vformat_to( detail::buffer&, string_view, basic_format_args, detail::locale_ref);