<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/115939>115939</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Bug with misc-unconventional-assign-operator in CRTP
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
higher-performance
</td>
</tr>
</table>
<pre>
```c++
template <class Derived>
struct Crtp {
Derived& operator=(decltype(nullptr)) {
return *static_cast<Derived*>(this);
};
};
struct S : Crtp<S> {
using Crtp<S>::operator=;
};
```
should not produce
```
<source>:3:3: warning: operator=() should return 'Crtp&' [misc-unconventional-assign-operator]
3 | Derived& operator=(decltype(nullptr)) {
| ^
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJykU82OmzAQfprhYiWyxybAgUNCNueq23tljAOuHBv5J6t9-4qEZrPVHipVMsLI8_34Y0bGaEandQvlAcpjIXOafGgnM046bGYdzj5cpFO66P3w3sKO3pcCPCyLHoHuk77MViZNgHfKyhjJUQdz1QPwl3tFTCGrRLqQZgLVCiOPMtwRP-sgkw_Aj4D1oJVN77MGrF22dk4BsAFsnsGEBJ1ycARwH5NMRv1UMibg3YN2vxjAOk0mLnj-wEJ1fHx92j-7fSXA9zfPwLtX4C9P6jkaNz6fAd8D3z_f4kv-P_mtQpPPdiDOJzIHP2SlvywD3kWfg9J3Hb4-5E0GZ9y4bD_HtyS1cj8yqm5mcQdYESgPFxPVJjvl3VW7ZLyTdnNvhs2Dqzx-ZM0JVB35719GVhooX_66ajG0fGh4IwvdsoozIUohWDG1VDG6Y_35XAnWIOtVzQWrz_15EFSKHS1MixQFYwyRUUHpVgy8rvFcD1j3u7ovQVB9kcZurb1etj6MhYkx65axsuFNYWWvbbxNAKLTb-R2CojLQIR2AW36PEYQ1JqY4gdNMsnq9pBH8mbSRP4hU2Ic6b7_-FbkYNsppTkujYMnwNNo0pT7rfIXwNMisb42c_C_tEqAp5uxCHhanV9b_B0AAP__LKUbVQ">