https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113159
--- Comment #20 from Gabriel Ravier <gabravier at gmail dot com> --- > In general, why avoiding std::sort crashes is considered a good thing? > Wouldn't we just hide the error and produce invalid results causing harder to > debug errors later in user's program? The issue with this is that in the status quo this isn't a consistent thing. I hope you would agree memory corruption is bad - and that's what will happen a lot of the time instead of a simple crash. Now, you might argue that checking, if it can be added in a lightweight manner, should invoke std::abort() rather than trying to avoid going out of bounds, but I don't think "this bug is invalid because i would like it to crash" is a good argument here.