https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115482
--- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> ---
In the second affected block, the dup call is also missing for avr:
if (auto fb = dynamic_cast<filebuf*>(sb))
if (int fd = fb->native_handle(); fd >= 0 && ::isatty(fd))
return ::fdopen(::dup(fd), "w"); // Caller must call fclose.
But none of that is used for avr because it's guarded by a #if defined
__cpp_rtti check and libstdc++ seems to default to -fno-rtti for avr.
