Fix #4303: avoid instantiating formatter<const T> (#4325)

This commit is contained in:
timsong-cpp
2025-01-24 12:53:10 -06:00
committed by GitHub
parent a3d05d70ce
commit f841ae61e2
2 changed files with 9 additions and 2 deletions

View File

@@ -1121,7 +1121,7 @@ using use_formatter =
bool_constant<(std::is_class<T>::value || std::is_enum<T>::value ||
std::is_union<T>::value || std::is_array<T>::value) &&
!has_to_string_view<T>::value && !is_named_arg<T>::value &&
!use_format_as<T>::value && !use_format_as_member<T>::value>;
!use_format_as<T>::value && !use_format_as_member<U>::value>;
template <typename Char, typename T, typename U = remove_const_t<T>>
auto has_formatter_impl(T* p, buffered_context<Char>* ctx = nullptr)