Suppress a bogus gcc warning

This commit is contained in:
Victor Zverovich 2023-05-22 11:03:01 -07:00
parent 70b6a6fa44
commit ef55d4f52e

View File

@ -1541,8 +1541,7 @@ constexpr auto encode_types() -> unsigned long long {
template <bool PACKED, typename Context, typename T, FMT_ENABLE_IF(PACKED)> template <bool PACKED, typename Context, typename T, FMT_ENABLE_IF(PACKED)>
FMT_CONSTEXPR FMT_INLINE auto make_arg(T& val) -> value<Context> { FMT_CONSTEXPR FMT_INLINE auto make_arg(T& val) -> value<Context> {
auto&& arg = arg_mapper<Context>().map(val); using arg_type = remove_cvref_t<decltype(arg_mapper<Context>().map(val))>;
using arg_type = remove_cvref_t<decltype(arg)>;
constexpr bool formattable_char = constexpr bool formattable_char =
!std::is_same<arg_type, unformattable_char>::value; !std::is_same<arg_type, unformattable_char>::value;
@ -1561,7 +1560,7 @@ FMT_CONSTEXPR FMT_INLINE auto make_arg(T& val) -> value<Context> {
formattable, formattable,
"Cannot format an argument. To make type T formattable provide a " "Cannot format an argument. To make type T formattable provide a "
"formatter<T> specialization: https://fmt.dev/latest/api.html#udt"); "formatter<T> specialization: https://fmt.dev/latest/api.html#udt");
return {arg}; return {arg_mapper<Context>().map(val)};
} }
template <typename Context, typename T> template <typename Context, typename T>