<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/106847>106847</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[clang] operator<=> generated too early
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
kelbon
</td>
</tr>
</table>
<pre>
```cpp
#include <vector>
struct X;
struct Y {
std::vector<X> x;
std::strong_ordering operator<=>(const Y& r) const = default;
};
struct X {
int i;
std::strong_ordering operator<=>(const X& r) const = default;
};
int main(){
Y y;
// error: object of type 'Y' cannot be compared because its 'operator<=>' is implicitly deleted
(void)(y <=> y);
}
```
https://godbolt.org/z/PP1as95Ks
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyck81u6zgMhZ-G3hANbCrxz8KLtKk3s-kyWQ1kiXE0o1iGJAfjefoLJblN29tVAUOGj3moj5QoQzDDyNzC5hk2u0zO8eR8-y_b3o1Z7_TSQr6DfAtlfnvUNN0VEmZUdtaMIF4urKLzIF7vP69riH5WEfcgnr-RDwjVXUdEDFGD2ILY_k71sgfxiv-9mx8RIXo3Dn87r9mbcUA3sZc3D4hdgqBauTFEPACV6IEavH2D2KHmo5xtfEBVu-8B958BzRjRfIn8CdP-R0y3NTGcpRmBaqDmE94Bl0erEBGoA-qQvU8QW3T9P6wiuiPGZWIEqg5AFSo5ji5iz6jceZKeNfas5BwYTQwp7JtKKjQBzXmyRploF9RsObL-uHl9cUYnRqoXfLfikqSPVX6-XR9rPcU4hdTcayGD072zceX8ANT9D9S9vRUyNJu_QqZboRvRyIzboqJNkQtRV9mppUaVa1nWG-Jc6mOlNBW5kk2jhJaFFplpKad1XouiKEjk61VZil71smn6XhwLqmCd81kau7L2ck57ZyaEmdsiL-t1lVnZsw3X4SFSVo4DEKU58m0yPPXzEGCdWxNieKSIJtrrxN0cm92flwUHHpPEGqNzyNLbJZu9bb80xcTT3K-UOwN1Kf_99TR5l04bqLvyBqDujnxp6VcAAAD__zfzJJE">