diff --git a/include/fmt/format.h b/include/fmt/format.h index 047144cf..119e36f1 100644 --- a/include/fmt/format.h +++ b/include/fmt/format.h @@ -297,6 +297,8 @@ template FMT_CONSTEXPR20 auto bit_cast(const From& from) -> To { #ifdef __cpp_lib_bit_cast if (is_constant_evaluated()) return std::bit_cast(from); +#elif FMT_HAS_BUILTIN(__builtin_bit_cast) + return __builtin_bit_cast(To, from); #endif auto to = To(); // The cast suppresses a bogus -Wclass-memaccess on GCC.