<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/84064>84064</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Clang error: coroutine member function with operator new in promise_type
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
andreasfertig
</td>
</tr>
</table>
<pre>
Hello,
the following code is accepted by g++ and MSVC, but rejected by Clang:
https://compiler-explorer.com/z/hG58nq7TE (lambda)
https://compiler-explorer.com/z/7WM7eP3h7 (struct and coroutine member function)
Without the `This` parameter for `operator new` and passing another parameter, the code is accepted by Clang but rejected by g++ and MSVC:
https://compiler-explorer.com/z/dnEhsj6hP
With my reading of http://eel.is/c++draft/dcl.fct.def.coroutine#4 and http://eel.is/c++draft/dcl.fct.def.coroutine#9.1 Clang is wrong in both cases. It should accept the first and second example but reject the third.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJykk81u2zgQgJ-GuhARaMrWz0GHxIl39xAgwAab44I_I5EBRapDqo779AVlI0mb9tD2QgnS8OPwmxkRox09QE92N2R3W4glmYC98BpBxAEw2bGQQZ_6v8G5QPiesFvCrs9rMkCH4Fw4Wj9SFTRQG6lQCuYEmsoTHQm_IfyGCq_p_b__7QnfU7kkivAM6hKzd8KPpLp-TzYpzTF_4wfCDypMs3WAV_Ayu4CApQoT4YcvhB_MX7vWf2oe7yjhrROT1ILw7lcpzdN9Aw-VaTIlJlxUWnNWAcOSrAc6wSQB6bB4lWzwr2ec1yebTFgSzUZIzR6NjaRmdBYoJkh5X8D8I8yAIgWkHo45IJ8x5yL4kQofkgF825RlZeCPxK7SPqj8oPt3rWp_Z-JzbR6-vySdThRB6JxwGGgmvgIBXGljJp_T0CiGlGHKlYNKpYahfBVKeLVd8_wjRFduLipspEcM-cVTGZKhSkSIJf0n0WjC4vRF32p0sBjPBY6ggtcUXsQ0O3gndI1LxqIuC91Xuqs6UUC_aVhX113FusL0dSfZptOS1W0tVduwjjFdgdKshq3UbWF7zviWVWzHGWt5W8pK1Tux2QhV1U01aLJlMAnrSuc-T2XAsbAxLtC3W1ZvCyckuLjOJudqHRPO85hin-Ov5DJGsmXOxhTfCMkmB_3ZCiAGJNX1zxuZHnNV3_dlNjhjmGyE_9NpBlos6Ppve2e0ySzy0jD55MvjasaQ7RF-WC-SS7ne5WsAAAD__3x3btc">