diff --git a/llvm/include/llvm/ADT/STLExtras.h b/llvm/include/llvm/ADT/STLExtras.h index e11d6cac7685e..eb441bb31c9bc 100644 --- a/llvm/include/llvm/ADT/STLExtras.h +++ b/llvm/include/llvm/ADT/STLExtras.h @@ -1194,7 +1194,8 @@ class indexed_accessor_iterator return index - rhs.index; } bool operator==(const indexed_accessor_iterator &rhs) const { - return base == rhs.base && index == rhs.index; + assert(base == rhs.base && "incompatible iterators"); + return index == rhs.index; } bool operator<(const indexed_accessor_iterator &rhs) const { assert(base == rhs.base && "incompatible iterators");