From 0204dd359d9e5fc8142549ee8f7092a29c66723d Mon Sep 17 00:00:00 2001 From: Victor Zverovich Date: Fri, 30 Aug 2024 18:30:20 -0700 Subject: [PATCH] Fix _BitInt formatter --- include/fmt/base.h | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/include/fmt/base.h b/include/fmt/base.h index ee3c79f3..4df7715b 100644 --- a/include/fmt/base.h +++ b/include/fmt/base.h @@ -456,7 +456,7 @@ template auto convert_for_visit(T) -> monostate { return {}; } # define FMT_USE_BITINT (FMT_CLANG_VERSION >= 1400) #endif -template struct bitint_traits {}; +template struct bitint_traits {}; #if FMT_USE_BITINT # pragma clang diagnostic push # pragma clang diagnostic ignored "-Wbit-int-extension" @@ -1531,14 +1531,12 @@ template struct arg_mapper { FMT_MAP_API auto map(double val) -> double { return val; } FMT_MAP_API auto map(long double val) -> long double { return val; } - template >::is_formattable)> - FMT_MAP_API auto map(T&& val) -> decltype(val) { + template ::is_formattable)> + FMT_MAP_API auto map(T val) -> typename bitint_traits::format_type { return val; } - template >::is_formattable)> - FMT_MAP_API auto map(T&&) -> unformattable { + template ::is_formattable)> + FMT_MAP_API auto map(T) -> unformattable { return {}; }