https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80472
--- Comment #9 from Jonathan Wakely <redi at gcc dot gnu.org> --- There is though. std::prev(it, n) is specified as std::advance(it, -n). Calling prev means advancing a negative amount. But I'm not sure what your point is. Currently there's no warning by default even though the compiler has detected UB. Are you saying it is better to not warn at all, and just have silent UB? If you want the warning to be improved, please open a separate bug report. This one is about the inability to enable warnings in system headers, not the quality of individual warnings.