Issue 81769
Summary C++20 says that these are ambiguous, even though the second is reversed
Labels new issue
Assignees
Reporter lednakashim
    I tried to build some code bases with gcc13 and `-Werror `but got hit by a bunch of

```
include/mlir/IR/TypeRange.h:207:19: error: C++20 says that these are ambiguous, even though the second is reversed: [-Werror]
 >   207 |     return lhs == rhs;
```

for example in

```
 static bool isEqual(mlir::TypeRange lhs, mlir::TypeRange rhs) {
    if (isEmptyKey(rhs))
      return isEmptyKey(lhs);
    if (isTombstoneKey(rhs))
      return isTombstoneKey(lhs);
    return lhs == rhs;
  }
```
Some number of these can be traced to unbalanced or missing consts?

```
template <typename RangeT>
inline bool operator==(ArrayRef<Type> lhs, const ValueTypeRange<RangeT> &rhs) {
 return lhs.size() == static_cast<size_t>(llvm::size(rhs)) &&
 std::equal(lhs.begin(), lhs.end(), rhs.begin());
}
```

Apparently you can't actually disable this error in gcc without knocking out almost all warnings
 https://stackoverflow.com/questions/77992645/silence-ambiguous-reversed-operator-warning-in-gcc13?noredirect=1#comment137501323_77992645

Not really sure how llvm deals with this stuff.

Additionally does llvm build with gcc13?

_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to