Skip to content

Commit

Permalink
Name vfprintf clashes with the identically named declaration in 'st…
Browse files Browse the repository at this point in the history
…dio.h' if that happens to be #included into the same TU. Fix this by using qualified name lookup instead of unqualified lookup that also enables ADL. (#3400)
  • Loading branch information
DanielaE authored Apr 23, 2023
1 parent eafcd3c commit f449ca0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions include/fmt/printf.h
Original file line number Diff line number Diff line change
Expand Up @@ -599,7 +599,7 @@ inline auto vsprintf(
basic_format_args<basic_printf_context_t<type_identity_t<Char>>> args)
-> std::basic_string<Char> {
auto buf = basic_memory_buffer<Char>();
vprintf(buf, detail::to_string_view(fmt), args);
detail::vprintf(buf, detail::to_string_view(fmt), args);
return to_string(buf);
}

Expand All @@ -626,7 +626,7 @@ inline auto vfprintf(
basic_format_args<basic_printf_context_t<type_identity_t<Char>>> args)
-> int {
auto buf = basic_memory_buffer<Char>();
vprintf(buf, detail::to_string_view(fmt), args);
detail::vprintf(buf, detail::to_string_view(fmt), args);
size_t size = buf.size();
return std::fwrite(buf.data(), sizeof(Char), size, f) < size
? -1
Expand Down

0 comments on commit f449ca0

Please sign in to comment.