diff --git a/include/fmt/core.h b/include/fmt/core.h index 9e0e8964..14ac2070 100644 --- a/include/fmt/core.h +++ b/include/fmt/core.h @@ -1109,6 +1109,11 @@ template constexpr auto count_named_args() -> size_t { return count::value...>(); } +template +constexpr auto count_statically_named_args() -> size_t { + return count::value...>(); +} + enum class type { none_type, // Integer types should go first, @@ -3043,7 +3048,8 @@ template class basic_format_string { std::is_reference::value)...>() == 0, "passing views as lvalues is disallowed"); #ifdef FMT_HAS_CONSTEVAL - if constexpr (detail::count_named_args() == 0) { + if constexpr (detail::count_named_args() == + detail::count_statically_named_args()) { using checker = detail::format_string_checker...>; detail::parse_format_string(str_, checker(s, {}));