#include <fmt/format.h>
struct E {};
template<>
struct fmt::formatter<E> : fmt::formatter<std::string_view> {
auto format(E, auto& ctx) const { return fmt::formatter<std::string_view>::format("42", ctx); }
};
void f() {
using namespace fmt::literals;
(void) fmt::format("{a}", "a"_a = E());
}
In file included from /opt/compiler-explorer/libs/fmt/trunk/include/fmt/format.h:49,
from <source>:1:
/opt/compiler-explorer/libs/fmt/trunk/include/fmt/core.h: In instantiation of 'constexpr decltype (ctx.begin()) fmt::v8::detail::parse_format_specs(ParseContext&) [with T = statically_named_arg<E, char, 2, fmt::v8::detail_exported::fixed_string<char, 2>{"a"}>; ParseContext = compile_parse_context<char, error_handler>; decltype (ctx.begin()) = const char*]':
/opt/compiler-explorer/libs/fmt/trunk/include/fmt/core.h:2894:22: required from 'constexpr fmt::v8::detail::format_string_checker<Char, ErrorHandler, Args>::format_string_checker(fmt::v8::basic_string_view<Char>, ErrorHandler) [with Char = char; ErrorHandler = fmt::v8::detail::error_handler; Args = {fmt::v8::detail::statically_named_arg<E, char, 2, fmt::v8::detail_exported::fixed_string<char, 2>{"a"}>}]'
<source>:11:23: required from here
/opt/compiler-explorer/libs/fmt/trunk/include/fmt/core.h:2658:12: error: use of deleted function 'fmt::v8::detail::fallback_formatter<T, Char, Enable>::fallback_formatter() [with T = fmt::v8::detail::statically_named_arg<E, char, 2, fmt::v8::detail_exported::fixed_string<char, 2>{"a"}>; Char = char; Enable = void]'
2658 | auto f = conditional_t<has_formatter<mapped_type, context>::value,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2659 | formatter<mapped_type, char_type>,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2660 | fallback_formatter<T, char_type>>();
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/opt/compiler-explorer/libs/fmt/trunk/include/fmt/core.h:1013:3: note: declared here
1013 | fallback_formatter() = delete;
| ^~~~~~~~~~~~~~~~~~
Compiler returned: 1
https://godbolt.org/z/haoG1o3Pq
with -std=c++2a/2b: