https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80472
--- Comment #10 from Jonathan Wakely <redi at gcc dot gnu.org> --- (In reply to Manuel López-Ibáñez from comment #8) > There is no negative n__ in user code. If you want to be pedantic, there's no __n at all in user code. Because it's a function parameter of std::advance. But clearly if the compiler says "undefined behaviour detected at this line" and the line has a comment saying "undefined if n is negative" then the user can figure out that the function got called with negative n. Is that perfect? No. Is it better than printing nothing when UB is detected? To me the answer is obviously yes, so it seems like you're just objecting to making improvements.