<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/81769>81769</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
C++20 says that these are ambiguous, even though the second is reversed
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
lednakashim
</td>
</tr>
</table>
<pre>
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?
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJysVctu6zYQ_ZrxZmBDImXLXmjh2DFwUaCLNGiXASWOJTYUqctHUvXrC0qK09ymQRcVCEoUh_M452gkvFetIapgewfb80rE0FlXaZJGPAvfqX5VWzlW3zA4RRKDxToqLdHbnrCxkrAWnjy-qtBh2zQ5R2Ekwi5b_0bOWZce6xiwtQE7FbAeUWAdTdOhvUJ2huy4zLtsGdNSmUZHScAuvVYO2OXbA7DL4zjQgzAtbTrgR5aVwI_5AfgRp2Dp4QTsDtgdy9CL0WPoRMD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