Skip to content

Commit 16de385

Browse files
committed
[libc++] Fix unnecessary fflush() in __vprint_unicode() on POSIX
Fixes #70142
1 parent 18e1179 commit 16de385

File tree

2 files changed

+1
-87
lines changed

2 files changed

+1
-87
lines changed

libcxx/include/print

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -230,15 +230,6 @@ __vprint_nonunicode(FILE* __stream, string_view __fmt, format_args __args, bool
230230
// terminal when the output is redirected. Typically during testing the
231231
// output is redirected to be able to capture it. This makes it hard to
232232
// test this code path.
233-
template <class = void> // TODO PRINT template or availability markup fires too eagerly (http://llvm.org/PR61563).
234-
_LIBCPP_HIDE_FROM_ABI inline void
235-
__vprint_unicode_posix(FILE* __stream, string_view __fmt, format_args __args, bool __write_nl, bool __is_terminal) {
236-
// TODO PRINT Should flush errors throw too?
237-
if (__is_terminal)
238-
std::fflush(__stream);
239-
240-
__print::__vprint_nonunicode(__stream, __fmt, __args, __write_nl);
241-
}
242233

243234
# ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
244235
template <class = void> // TODO PRINT template or availability markup fires too eagerly (http://llvm.org/PR61563).
@@ -310,7 +301,7 @@ __vprint_unicode([[maybe_unused]] FILE* __stream,
310301
// Windows there is a different API. This API requires transcoding.
311302

312303
# ifndef _WIN32
313-
__print::__vprint_unicode_posix(__stream, __fmt, __args, __write_nl, __print::__is_terminal(__stream));
304+
__print::__vprint_nonunicode(__stream, __fmt, __args, __write_nl);
314305
# elif !defined(_LIBCPP_HAS_NO_WIDE_CHARACTERS)
315306
__print::__vprint_unicode_windows(__stream, __fmt, __args, __write_nl, __print::__is_terminal(__stream));
316307
# else

libcxx/test/libcxx/input.output/iostream.format/print.fun/vprint_unicode_posix.pass.cpp

Lines changed: 0 additions & 77 deletions
This file was deleted.

0 commit comments

Comments
 (0)