diff --git a/llvm/include/llvm/ADT/STLExtras.h b/llvm/include/llvm/ADT/STLExtras.h --- a/llvm/include/llvm/ADT/STLExtras.h +++ b/llvm/include/llvm/ADT/STLExtras.h @@ -1114,9 +1114,9 @@ iterator begin() const { return iterator(base, 0); } iterator end() const { return iterator(base, count); } - ReferenceT operator[](unsigned index) const { + ReferenceT operator[](size_t index) const { assert(index < size() && "invalid index for value range"); - return DerivedT::dereference_iterator(base, index); + return DerivedT::dereference_iterator(base, static_cast(index)); } ReferenceT front() const { assert(!empty() && "expected non-empty range");