diff --git a/llvm/include/llvm/ADT/STLExtras.h b/llvm/include/llvm/ADT/STLExtras.h index e42b0e8d1b27b..18bc4d108b156 100644 --- a/llvm/include/llvm/ADT/STLExtras.h +++ b/llvm/include/llvm/ADT/STLExtras.h @@ -1291,11 +1291,15 @@ class indexed_accessor_range_base { } /// Compare this range with another. - template bool operator==(const OtherT &rhs) const { - return std::equal(begin(), end(), rhs.begin(), rhs.end()); - } - template bool operator!=(const OtherT &rhs) const { - return !(*this == rhs); + template + friend bool operator==(const indexed_accessor_range_base &lhs, + const OtherT &rhs) { + return std::equal(lhs.begin(), lhs.end(), rhs.begin(), rhs.end()); + } + template + friend bool operator!=(const indexed_accessor_range_base &lhs, + const OtherT &rhs) { + return !(lhs == rhs); } /// Return the size of this range.