diff --git a/include/fmt/core.h b/include/fmt/core.h index 697f4a60..45d8dd37 100644 --- a/include/fmt/core.h +++ b/include/fmt/core.h @@ -402,18 +402,17 @@ FMT_DISABLE_CONVERSION_TO_INT(long double); // Disambiguates conversions to different integral types. struct type_selector { - using char2 = struct { char a[2]; }; - static char convert(...); - static char convert(int); - static char convert(unsigned); - static char convert(long); - static char convert(unsigned long); - static char2 convert(long long); - static char2 convert(unsigned long long); + static int convert(...); + static int convert(int); + static unsigned convert(unsigned); + static long convert(long); + static unsigned long convert(unsigned long); + static long long convert(long long); + static unsigned long long convert(unsigned long long); template static constexpr type select() { - return sizeof(convert(std::declval())) == 1 ? INT : LONG_LONG; + return sizeof(convert(std::declval())) == sizeof(int) ? INT : LONG_LONG; } };