Skip to content

Commit

Permalink
Issue fmtlib#2816: also strip named-arg for the fallback formatter
Browse files Browse the repository at this point in the history
  • Loading branch information
timsong-cpp committed Mar 18, 2022
1 parent 47d5762 commit b15699a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions include/fmt/core.h
Original file line number Diff line number Diff line change
Expand Up @@ -2665,13 +2665,14 @@ FMT_CONSTEXPR auto parse_format_specs(ParseContext& ctx)
-> decltype(ctx.begin()) {
using char_type = typename ParseContext::char_type;
using context = buffer_context<char_type>;
using stripped_type = typename strip_named_arg<T>::type;
using mapped_type = conditional_t<
mapped_type_constant<T, context>::value != type::custom_type,
decltype(arg_mapper<context>().map(std::declval<const T&>())),
typename strip_named_arg<T>::type>;
stripped_type>;
auto f = conditional_t<has_formatter<mapped_type, context>::value,
formatter<mapped_type, char_type>,
fallback_formatter<T, char_type>>();
fallback_formatter<stripped_type, char_type>>();
return f.parse(ctx);
}

Expand Down

0 comments on commit b15699a

Please sign in to comment.