<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/154577>154577</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Cannot delete constructor with nullptr_t, parses as data member instead
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
dascandy
</td>
</tr>
</table>
<pre>
The following code
struct C {
C(nullptr_t) = delete;
};
results in the compile error
<source>:2:7: error: field has incomplete type 'C'
2 | C(nullptr_t) = delete;
| ^
<source>:1:8: note: definition of 'C' is not complete until the closing '}'
1 | struct C {
| ^
Expected behavior is that the construction from nullptr_t is marked as a deleted function, so users get clearer error messages. Tested on LLVM/Clang trunk as per 20-08-2025 on Godbolt:
https://godbolt.org/z/xvn8ozva1
Changing the function to `C(decltype(nullptr)) = delete;` works as a workaround.
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJyMk8GS4yYQhp-mdekaFwbJ2AcdNJpRLpvbVq4pJNoSGQQqQPbOPn0KS7OT3eQQXQzm7-7v7wYVoxkdUQ3VM1QvhVrT5EOtVRyU0-9F7_V7_XUivHpr_d24EQevCVgDrEFEjCmsQ8IWQT7nv1rgZ7dau6TwZwJ-QRAvqMlSIhDPexDIl20DrAkUV5siGodpIhz8vBhLSCH4gHsdEG30axgIxCuIhoNoJIhmE-XF1ZDVOKmcJmfI5TC9L4TAZQtc7oXzxxFk-_84ty_L91X1-uHgZ6IjiOacQZzP8Q1quhpnkvEO_fUDAk3MAvxBuLpk7Gbb-pibm1Hly8_AxwfBr43-D7ydD1jz-m2hIZHGniZ1Mz7k0mlSae-x27JlvGvwM_7oRNbNKryRRhVR7R3ReF3dQw68xehxjRQijpRwsKQChX1eM8WoRooH_Eoxx3mHX7788TvwrrXKjZjC6t5y6oUCcvbEzk-c8SrrfvO69zaBaDYPU0pLzDveAe_G7fTgwwi8-w68-3ZzZ__9po6bvJ2UG3MLs8MPXEwe4cTysDUNNt-Iz7kDv_x78CeGdx_e4mY_L1Xwq9OHQtdCX8RFFVQfZVXJIzsdWTHVxGRV6Z6zUpSCX0pFp7LSpazkWUqhqsLU2SI7c3aUXAh2EOdeCXbpq3I4VZeBQcloVsYerL3N2WFhYlypPlZlJWVhVU82Pl4o547u-DgFzvODDXUOeurXMULJrIkpfqZJJlmqW-Xyrds8fg7fB7ybNOE_XkGLiwqRHua1SgpnmnsKaFxMpHSxBlv_MhaTprU_DH4G3uW6-8_TEvxfNCTg3YM2Au92O7ea_x0AAP__U-RhgA">