<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/72071>72071</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
suggest `= default` for default equality operator implementations starting with C++20
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
firewave
</td>
</tr>
</table>
<pre>
```cpp
struct S
{
bool operator==(const S& other) const
{
return i == other.i;
}
int i{0};
};
```
https://godbolt.org/z/qcKr6cz3x
Starting with C++20 it is possible to define default `operator==` implementations. Existing implementations that could be replaced with the default one should probably be reported by `modernize-use-equals-default`.
See https://en.cppreference.com/w/cpp/language/default_comparisons for details.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJxsU81yozAMfhpz0YQxhkA4cGg2y2WPfYAdYwR4x9jUFk3Tp9_hp03TXY9n_CPpsz7pswxB9xaxYsczO14iOdPgfNVpj1f5ilHj2lvFcr5NNU2MXxh_CuRnRfC8nVhx3jYAAI1zBtyEXpLzLL0sU5yUs2HxFzk4GtAzUcJ2d498gFmGR5q9BQ0bzBYZa5aevwZd9iQ-r7Ql0Kw488X24fuw_-CzHQeiKbD0iYmaibp3beMMxc73TNTvTNQv6pfP1Xv69vWhZ5KetO3hqmmAH0ycmTgLDppAB5hcCLoxCOSgxU5bXBY5GwKW82_VyTnocTI4oiVJ2tkQw883HVb4bxagQRIoN5sWGgSPk5EK2y0LGu7POIsQhtVv8q6RjbntAc4TttDclkxG16K3-h0Pc8ADvszShMMOwXIePzBGhMdSoY3VNHns0KNVGCs3MlFfmagXoYjaSNvPskcm6h3zt3LjJL0OC5XOeWiRpDYhjtoqbcu0lBFWSV6WpzTLj0U0VKIUPM9UrrrTSbWImGVlKY_Iu4KXXZpEuhJcpEmSpJwnRVrESorkdEwyfuTipIqGZRxHqU1szOu4tDXSIcxYFYIXSWRkgyas8hfC4hVWIxNi-Q2-WmIOzdwHlnGjA4U7CmkyWIW57zGsbV0keq_dTm_rxlpZTbfPj_FPX8P_9RTN3lTfBKppmJu92Es2-3KYvPuDipioVw6BiXrl-DcAAP__Lr03-Q">