When formatting a variant, fmt 12.0.0 chokes if any of the alternatives relies on format_as to be formattable. [The documentation says:](https://fmt.dev/12.0/api/#variants) > A std::variant is only formattable if every variant alternative is formattable, and requires the __cpp_lib_variant [library feature](https://en.cppreference.com/w/cpp/feature_test). Which does not seem to align with the behavior. Godbolt link: https://godbolt.org/z/vrjEPsbvr Code: ```cpp #include <fmt/format.h> #include <fmt/std.h> #include <iostream> struct foo { float bar; friend float format_as(const foo& f) { return f.bar; } }; int main() { foo simple_foo{}; std::variant<foo> variant_foo{}; std::variant<float> variant_float{}; std::cout << fmt::format("{}", simple_foo); // ok std::cout << fmt::format("{}", variant_float); // ok std::cout << fmt::format("{}", variant_foo); // broken } ``` Error log (from Godbolt): https://pastebin.com/LXiBz4mX