diff --git a/include/fmt/core.h b/include/fmt/core.h index a8742c5f..5dc4e352 100644 --- a/include/fmt/core.h +++ b/include/fmt/core.h @@ -1285,8 +1285,14 @@ template struct arg_mapper { FMT_CONSTEXPR FMT_INLINE auto map(T val) -> char_type { return val; } - template ::value && - !std::is_same::value)> + template ::value || +#ifdef __cpp_char8_t + std::is_same::value || +#endif + std::is_same::value || + std::is_same::value) && + !std::is_same::value, + int> = 0> FMT_CONSTEXPR FMT_INLINE auto map(T) -> unformattable_char { return {}; } diff --git a/test/core-test.cc b/test/core-test.cc index c99098cb..5cf9dbd8 100644 --- a/test/core-test.cc +++ b/test/core-test.cc @@ -739,6 +739,11 @@ TEST(core_test, is_formattable) { static_assert(fmt::is_formattable::value, ""); static_assert(fmt::is_formattable::value, ""); static_assert(!fmt::is_formattable::value, ""); +#ifdef __cpp_char8_t + static_assert(!fmt::is_formattable::value, ""); +#endif + static_assert(!fmt::is_formattable::value, ""); + static_assert(!fmt::is_formattable::value, ""); static_assert(!fmt::is_formattable::value, ""); static_assert(!fmt::is_formattable::value, ""); static_assert(!fmt::is_formattable>::value,