https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113960
--- Comment #5 from Jonathan Wakely <redi at gcc dot gnu.org> --- But it's guarded by: if constexpr (__is_byte_iter<_InputIter1>) if constexpr (__is_byte_iter<_InputIter2>) This condition is only supposed to be true when sizeof(*__first1) == 1 and sizeof(*__first2) == 1 We can only use memcmp if we're comparing single bytes as unsigned values (and if the iterators are pointers to contiguous memory, not e.g. segmented iterators like std::deque's, or not even random access iterators, like std::list's). For std::vector<unsigned short> we should not use this code at all.