https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71545
--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> --- The irreflexive assertion is incorrect for lexicographical compare too: #include <algorithm> struct X { }; bool operator<(X, int) { return true; } bool operator<(int, X) { return false; } // Not a strict weak order bool operator<(X, X) { return true; } int main() { X x[1]; int i[1]; std::lexicographical_compare(x, x+1, i, i+1); } This fails in Debug Mode because operator<(X, X) doesn't define a strict weak order, but that operator is not used by the algorithm.