https://gcc.gnu.org/bugzilla/show_bug.cgi?id=28103
--- Comment #4 from Jonathan Wakely <redi at gcc dot gnu.org> --- (In reply to Jonathan Wakely from comment #3) > The requirement to set failbit came from > https://cplusplus.github.io/LWG/issue211 and certainly seems consistent with > other input operations, which set failbit not badbit. > > N.B. https://wg21.link/p1264r2 cleaned up the wording for input operations, > making it clear that badbit should only be set by the library after an input > operation throws an exception. Oops that's for input ops and this is about output!