Fix gcc 11 build.

This commit is contained in:
Ivan Lazaric 2026-09-27 14:35:20 +02:00
parent b40d393e11
commit b118fa2dbe

View File

@ -497,7 +497,7 @@ TEST(compile_test, format_as) {
struct constexpr_enabled {};
template <> struct fmt::formatter<constexpr_enabled> {
template <> struct fmt::formatter<constexpr_enabled> : formatter<const char*> {
bool debug = false;
FMT_CONSTEXPR auto parse(format_parse_context& ctx) -> decltype(ctx.begin()) {
if (ctx.begin() != ctx.end() && *ctx.begin() == '?') {
@ -509,8 +509,7 @@ template <> struct fmt::formatter<constexpr_enabled> {
template <typename FormatContext>
FMT_CONSTEXPR auto format(constexpr_enabled, FormatContext& ctx) const
-> decltype(ctx.out()) {
return fmt::formatter<std::string_view>{}.format(
debug ? "debug" : "regular", ctx);
return formatter<const char*>::format(debug ? "debug" : "regular", ctx);
}
};