<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/63960>63960</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[clang] Diagnostics falsely says that no viable `operator<=>` was found instead of `operator==` for a defaulted, implicitly deleted `operator==`
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
AMP999
</td>
</tr>
</table>
<pre>
https://godbolt.org/z/cMKE3o1aG
```c++
struct C {
friend std::strong_ordering operator<=>(const C&, const C&);
};
struct S {
C c;
bool operator==(const S&) const = default; //obscure warning
};
```
When defaulting an `operator==`, if there’s no viable `operator==` for a member, the compiler complains that the defaulted `operator==` is implicitly deleted "`because there is no viable three-way comparison function for member 'c'`", but we are actually looking for an equality operator in the member, not a three-way comparison operator.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJx8VEFv2zoM_jX0hWigSLEdH3xo4-YdHgo8oId3HGSZtrUpUibJDbJfP8hx0q7LBggJJZH8vo8iLUPQgyWqIX-CvMnkFEfn68eX_6qqylrXnesxxmMA8Qh8D3w_uK51Jq6cH4DvfwDfq5d_n4Vby3-ANcAel9-CXZYC_pTWfBqin1TEHUK5nCAi9l6T7TDELqGI5OXs8MX5jry2A7ojeRmdB7ED0YB4Br5VzoaIO-AF8B1-3FUgltxQNjd7QX79FXmH6uaR9q1z5gNck9YV6_WSfcEC0WBHvZxMBPGEl9q4NqjJE56kt9oOv7O4VeVjqf4fyV5zJbnSIhTsE4uCJZ26xziSJ3jmsGVQVQGtwzctW0N3g7B3HiUe6NCSTxniSKjc4agN-dkwUtuAcZRxvlt4UHc_nQ6oD0ejlY7mjB0Zml05h4K1pOQU6MIweb5Ti6MnejjJ8wwpvQ7OYj9ZFXUynF8YIvBSAS9nuTzxbaeIJ0LpCaWKkzTmjMa5b6lQszaL9H2SRsfz7eFQ21nLu2rrIsr7LK5Bq6yrRVeJSmZUr4ttVZbVuhTZWHdUtT2pnJc5K7jaqkIprtZMCM4U3_SZrjnjgpXrap2zYs1XvJRdT90231RtVfYKNowOUpuVMW-HNDmZDmGiuhBVwTIjWzJhHkDOLZ1wvkz68ybzdYp5aKchwIYZHWJ4zxJ1NPPkKiPtAHmDjZaDdSFqFbCXJpA5Y5Dn5YH_0CvXqSoYnmTA3k22Q21DJNmh6__WWLd2mbvzTmfcCc0mbz5_VHQcp3al3AH4Pslb_h6O3n0lFYHv56IE4Pu5aD8DAAD__6e9eQ8">