<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/151468>151468</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[Clang] Clang and GCC diverge on parsing `new (std::nothrow_t())`
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
Xniao
</td>
</tr>
</table>
<pre>
## Description:
I'm seeking clarification on whether the following code is well-formed C++.
GCC accepts it, but Clang rejects it with:
`error: cannot allocate function type 'std::nothrow_t ()' with new`
## Program
```cpp
#include <new>
int main() {
char* p = new (std::nothrow_t()) char[1];
return 0;
}
```
Is this a parsing difference, or is one compiler incorrect?
Repro: https://godbolt.org/z/17zfedxds
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJyEkkGPpDYQhX9NcSlNy9gNNAcOdHc6mluUU26RsQtwYmxkm-nM_PrIMKNd7R5WQkIYv1fPz5-M0UyOqIPqCtW9kFuafej-ckb6YvD6vQMugAu8U1TBrMl4B6IH1r8CbxaMRP8aN6GyMpjRKJk3oHf4nCnNFDDNhKO31j_3bV4TmohPsvZl9GEhjTfgV-DXEyKw_vfbDaVStKaIJgG_4bAlvFnpJgz0D6l9HZ8mzSD6XQI1oxB8yN9KOucTSmu9kolw3JzaE6X3lRB4E5PO8UXvfJqDf_6dEPgFeAu82V3R0RNqln1Z_3n2P4KfglyOWcej1vX4b5yymyYEcctK8duhNC7hIo07zBGaK7AeEVHNMgDvcUUQ9zwsz_851Veo9hBU1xKqO4gvl0BpCw7ZsQLN_ftsR4LXiGk2ESWuMsRcvjbjSIGcotyrD_kivCNUflmNpYDGKR8CqQTiAaz_k9bgc6tzSmvMAfkD-GPyevA2nXyYgD8-gD_K5mMk_Z-Ohe6EbkUrC-rKphLtueWcFXOnVd3Uo9ScVFtd1FAOI6vqsRHtRQwVKwvTccYr1oiSXVjD2Ek0YylqOchzK8czCTgzWqSxJ2vfljy7MDFu1JVVea4vhZUD2bhTzLnKuADnGejQZcHLsE0RzsyamOI3i2SS3dHfAYPq_kmadBozidq8UZgo8_xVItTs15cGNSu2YLsfijNp3oaT8gvwR87w-XpZg89kA3_sZ4q50uNYbx3_PwAA___QMxz4">