diff --git a/llvm/include/llvm/ADT/STLExtras.h b/llvm/include/llvm/ADT/STLExtras.h index 18bc4d108b156..e42b0e8d1b27b 100644 --- a/llvm/include/llvm/ADT/STLExtras.h +++ b/llvm/include/llvm/ADT/STLExtras.h @@ -1291,15 +1291,11 @@ class indexed_accessor_range_base { } /// Compare this range with another. - 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); + 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); } /// Return the size of this range.