<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/105334>105334</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Unexpected error with member new operator
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang:frontend
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
efriedma-quic
</td>
</tr>
</table>
<pre>
Consider the following:
```
typedef decltype(sizeof(int)) size_t;
struct S {
void* operator new(size_t size, size_t c) noexcept;
};
S* s = new(1) S;
```
clang 18 accepts, clang 19 rejects (because -fsized-deallocation was enabled by default). Not sure if this behavior is expected; MSVC rejects the testcase, gcc accepts it.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJxUkkFvoz4QxT-NuYwSmYEk5sChbZTb_3-Jdq-VsQfwysGsPSTtfvqVKW21EjJmxPz85vnplNwwEbXi8CwO50IvPIbYUh8d2Zve_V6cKbpg39uXMCVnKQKPBH3wPjzcNIjqScizkJ_rUW7P-snvM1nqwZLxeS9QJfeHQi9QuYkFNgIbyKVXFtXzR1PiuBiGK4jTVgEAuAdnBT5BmClqDhEmemy4V14RAl82FJiMnQK9GZq_weJ0_tpfMyuBqM4bqMwt1-9__x3kYzVeTwOUCrTJ4JRP3GoNRPpFhhMIVB0ZvSSCXZ_12J0l7X0wml2Y4KET0KQ7Txa6d7DU68VnK_YA_weGtEQC1wOPLkFHo767EMEloLeZDJMV1TP8d_358nVivhCmxEan1YTBmE-F4Hhf2LayTdXogtryhHWpDse6Kca2PNWmPiplGtWrjupGS3WsD6o5WkuVNYVrUWItFUqUeMJm39RSWeyM7Es0TaVFLemmnd97f7_tQxwKl9JCbSkPVVUXXnfk0xotxNUoUT31MUxMkxWIOXCxzb27bhmSqKV3idM3jR17an9Mn6MDxRgiPByPcKNbR2sMvjJRLNG3I_OccizxIvAyOB6Xbm_CTeAlc7fXbo4huyfwskpOAi-b6nuLfwMAAP__KEb3yA">