https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109891
--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> --- Adding more UB to the library doesn't seem wise. We could make it abort in debug mode, instead of setting badbit, but I don't think we should just make it UB.