diff --git a/libcxx/include/__format/formatter.h b/libcxx/include/__format/formatter.h --- a/libcxx/include/__format/formatter.h +++ b/libcxx/include/__format/formatter.h @@ -181,13 +181,11 @@ * @param __precision The width to truncate the input string to, use @c -1 for * no limit. */ -template -_LIBCPP_HIDE_FROM_ABI auto -__write_unicode(output_iterator auto __out_it, - basic_string_view<_CharT> __str, ptrdiff_t __width, - ptrdiff_t __precision, _Fill __fill, - __format_spec::_Flags::_Alignment __alignment) - -> decltype(__out_it) { +template +_LIBCPP_HIDE_FROM_ABI auto __write_unicode(output_iterator auto __out_it, + basic_string_view<_CharT, _Traits> __str, ptrdiff_t __width, + ptrdiff_t __precision, _Fill __fill, + __format_spec::_Flags::_Alignment __alignment) -> decltype(__out_it) { // This value changes when there Unicode column width limits the output // size. diff --git a/libcxx/include/__format/formatter_string.h b/libcxx/include/__format/formatter_string.h --- a/libcxx/include/__format/formatter_string.h +++ b/libcxx/include/__format/formatter_string.h @@ -38,11 +38,10 @@ namespace __format_spec { -template <__formatter::__char_type _CharT> +template <__formatter::__char_type _CharT, class _Traits = char_traits<_CharT> > class _LIBCPP_TEMPLATE_VIS __formatter_string : public __parser_string<_CharT> { public: - _LIBCPP_HIDE_FROM_ABI auto format(basic_string_view<_CharT> __str, - auto& __ctx) -> decltype(__ctx.out()) { + _LIBCPP_HIDE_FROM_ABI auto format(basic_string_view<_CharT, _Traits> __str, auto& __ctx) -> decltype(__ctx.out()) { _LIBCPP_ASSERT(this->__alignment != _Flags::_Alignment::__default, "The parser should not use these defaults"); @@ -125,25 +124,23 @@ // Formatter std::string. template -struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT - formatter, _CharT> - : public __format_spec::__formatter_string<_CharT> { - using _Base = __format_spec::__formatter_string<_CharT>; +struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT formatter, _CharT> + : public __format_spec::__formatter_string<_CharT, _Traits> { + using _Base = __format_spec::__formatter_string<_CharT, _Traits>; _LIBCPP_HIDE_FROM_ABI auto format(const basic_string<_CharT, _Traits, _Allocator>& __str, auto& __ctx) -> decltype(__ctx.out()) { - return _Base::format(_VSTD::basic_string_view<_CharT>(__str), __ctx); + return _Base::format(_VSTD::basic_string_view<_CharT, _Traits>(__str), __ctx); } }; // Formatter std::string_view. template -struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT - formatter, _CharT> - : public __format_spec::__formatter_string<_CharT> {}; +struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT formatter, _CharT> + : public __format_spec::__formatter_string<_CharT, _Traits> {}; -#endif // !defined(_LIBCPP_HAS_NO_CONCEPTS) +# endif // !defined(_LIBCPP_HAS_NO_CONCEPTS) #endif //_LIBCPP_STD_VER > 17