diff --git a/include/fmt/ostream.h b/include/fmt/ostream.h index b77bd9a7a984..e228cfc6f983 100644 --- a/include/fmt/ostream.h +++ b/include/fmt/ostream.h @@ -93,7 +93,7 @@ inline bool write(std::wfilebuf&, fmt::basic_string_view) { // It is a separate function rather than a part of vprint to simplify testing. template void write_buffer(std::basic_ostream& os, buffer& buf) { - if (FMT_MSC_VER) { + if (const_check(FMT_MSC_VER)) { auto filebuf = dynamic_cast*>(os.rdbuf()); if (filebuf && write(*filebuf, {buf.data(), buf.size()})) return; }