diff --git a/llvm/include/llvm/ADT/STLExtras.h b/llvm/include/llvm/ADT/STLExtras.h index a136eeb0ff1b..73cfa90baac0 100644 --- a/llvm/include/llvm/ADT/STLExtras.h +++ b/llvm/include/llvm/ADT/STLExtras.h @@ -1203,7 +1203,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");