https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100366
--- Comment #3 from Sam Varshavchik <mr...@courier-mta.com> --- If the warning is justified then something else isn't adding up. I double-checked (with cppreference.com) something that I was pretty sure of: and an insert() at the end() iterator is valid. The insert()ed range is valid. If the C++ code is UB, or even potentially UB, I don't see it.