https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89740
--- Comment #4 from bert hubert <ahu at ds9a dot nl> --- I did a longer writeup here, where I tentatively conclude this is not a bug, just highly unfortunate: https://ds9a.nl/articles/posts/iostreams-unexpected/