diff --git a/include/fmt/core.h b/include/fmt/core.h index f5eb7e3a..0e6422d9 100644 --- a/include/fmt/core.h +++ b/include/fmt/core.h @@ -1460,7 +1460,7 @@ make_args_checked(const S& format_str, all_true<(!std::is_base_of>::value || !std::is_reference::value)...>::value, "passing views as lvalues is disallowed"); - check_format_string>...>(format_str); + check_format_string(format_str); return {args...}; } diff --git a/include/fmt/format.h b/include/fmt/format.h index acd7d9dc..5d36a682 100644 --- a/include/fmt/format.h +++ b/include/fmt/format.h @@ -2641,10 +2641,9 @@ FMT_CONSTEXPR bool do_check_format_string(basic_string_view s, template ::value), int>> void check_format_string(S format_str) { - FMT_CONSTEXPR_DECL bool invalid_format = - internal::do_check_format_string( - to_string_view(format_str)); + FMT_CONSTEXPR_DECL bool invalid_format = internal::do_check_format_string< + typename S::char_type, internal::error_handler, + remove_const_t>...>(to_string_view(format_str)); (void)invalid_format; } diff --git a/test/format-test.cc b/test/format-test.cc index 8bce69be..b1730630 100644 --- a/test/format-test.cc +++ b/test/format-test.cc @@ -1859,6 +1859,8 @@ TEST(FormatTest, CustomFormatCompileTimeString) { EXPECT_EQ("42", fmt::format(FMT_STRING("{}"), Answer())); Answer answer; EXPECT_EQ("42", fmt::format(FMT_STRING("{}"), answer)); + char buf[10] = {}; + fmt::format_to(buf, FMT_STRING("{}"), answer); const Answer const_answer = Answer(); EXPECT_EQ("42", fmt::format(FMT_STRING("{}"), const_answer)); }