https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108886
Jonathan Wakely <redi at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |WONTFIX Status|UNCONFIRMED |RESOLVED --- Comment #6 from Jonathan Wakely <redi at gcc dot gnu.org> --- (In reply to Jonny Grant from comment #4) > Defensive programming is carefulness in libraries too; particularly > interfaces. And libstdc++ tries to check every checkable precondition with debug assertions. > The C++ standard group have a paper "P2698R0 Unconditional termination is a > serious problem" you may have seen. That's about C++ contracts. When the library starts to use contracts, you'll be able to choose how your program handles contract violations, without forcing that choice on everybody. Until then, libstdc++ uses assertions for precondition checks. I'm not going to change basic_string::assign to throw.