https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119415
--- Comment #9 from Tomasz KamiĆski <tkaminsk at gcc dot gnu.org> --- > Hum, meeting Cpp17LegacyIterator requirements does not mean it is a C++17 > input iterator, only iterator_traits<It>::iterator_category represents its > category, so __cpp17_input_iterator should not be used here. There are more things that insert(pos, it, it) could rely on from the old iterator model, including the iterator being copyable (not only sentinel) or *it++ being well-formed. Checking __cpp17_input_iterator establish that all of above is true. And for that types of iterators iterator_traits<It>::iterator_category will generated correctly.