Skip to content

Commit

Permalink
Revert "[STLExtras] Remove incorrect hack to make indexed_accessor_ra…
Browse files Browse the repository at this point in the history
…nge operator== compatible with C++20" (llvm#72265)

Reverts llvm#72220

This breaks C++20 build bot. Need to see if upgrading to clang-17 in the
build bot would solve the issue.
  • Loading branch information
usx95 authored Nov 14, 2023
1 parent 33374c4 commit 94d6699
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions llvm/include/llvm/ADT/STLExtras.h
Original file line number Diff line number Diff line change
Expand Up @@ -1291,11 +1291,15 @@ class indexed_accessor_range_base {
}

/// Compare this range with another.
template <typename OtherT> bool operator==(const OtherT &rhs) const {
return std::equal(begin(), end(), rhs.begin(), rhs.end());
}
template <typename OtherT> bool operator!=(const OtherT &rhs) const {
return !(*this == rhs);
template <typename OtherT>
friend bool operator==(const indexed_accessor_range_base &lhs,
const OtherT &rhs) {
return std::equal(lhs.begin(), lhs.end(), rhs.begin(), rhs.end());
}
template <typename OtherT>
friend bool operator!=(const indexed_accessor_range_base &lhs,
const OtherT &rhs) {
return !(lhs == rhs);
}

/// Return the size of this range.
Expand Down

0 comments on commit 94d6699

Please sign in to comment.