https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93059
--- Comment #43 from Jonathan Wakely <redi at gcc dot gnu.org> --- (In reply to fdlbxtqi from comment #39) > const auto __c = __builtin_memcmp(&*__first1, &*__first2, __len) <=> 0; Are you mistakenly reading this as dereferencing &*begin and &*end of an iterator range? Because that's not what it does. It dereferences the begin iterator of two separate non-empty ranges. There is no past-the-end iterator in this statement.