<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/68198>68198</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Bug with aggregate initialization with a parenthesized list of values
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
gbMattN
</td>
</tr>
</table>
<pre>
As of c++20, you can use a parenthesized list to initialize a dynamic array, but the following code
```
int test_it (void) {
double *ptr;
ptr=new double[](1,2,3);
return 0;
}
int main(void) {
return test_it();
}
```
Gives the error
```
paren.cpp:4:9: error: array 'new' cannot have initialization arguments
4 | ptr=new double[](1,2,3);
| ^ ~~~~~
1 error generated.
```
This was built on Ubuntu 22.04 using the main branch of llvm at time of reporting (75f295c2455131993f9c945320736b84c5fcf99c) with the -stdc++20 flag.
It builds successfully on up to date versions of GCC (from 11.1)
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyUVMGu6yYQ_Rq8Gd3IHuw4LLxIcpunLtpVu64wHttUDkQwJMpb9NsrnOjmvup28VCkgDlnOHOGQcdoJ0fUieYgmvdCJ5596Kb-N838e9H74d7tI_gRjMCDwAOWAo9w9wmMdpAigYaLDuR4pmi_0wCLjQzswTrLVi_2e4YMd6fP1oAOQd9zhD4x8Eww-mXxN-smMH4gUb6Lci-25fO3Lq1jYIr8l2UQuLt6OwhUINrDYx8A4DUbfOoXAoH7CwchP2HW9buj2xPzSFngrhJ4RIFHKVB9MJ68QJyCg_L1vX3_DMjiztq6_xP25D_1C9z9cMZHrB8z_mavFFd7KAQfvsSspm_M5SLkvhZyr4TcP-Fy__AZBLaObgLbXCznGWZ9pVdhNFvvQIcpnclxfImuQbRH-HnPVsoHd503v8Cn8U8eD2z1EAsTOQqaadh8meYfs41w0xH6ZBcG7-DPPjlOgLgpa0gxX53sVC4C9EE7M-fruizXM2gGtmfK60AXHziDBe7aZkTVGKybppKVUnJURtWNxLKV235Xm2Y0o1ImV_NmeV4PeIs8fDQBjIuenop_5VXcECEmYyjGMS3LPUtNl9wIg2aCK4VovVtb6dvxmFWMwZ-hqjZVtnCNVAydHJRUuqCu2qptXTWybou526qx3bZabkvVVlrratAGjZGtIS1VrQvbYYmyKsu6KlGV7Qbr2uBQqR01VJZtLeqSztoum2zMxoepsDEm6ra7Su2KRfe0xPURQMzVXjcFYn4TQpc5b32aoqjL3N7xFYUtL9Qd0vQwSk9ToCkn_J9b9tj96qnwI1z1kigWKSzdzHyJQu4FngSeJstz6jfGnwWe8pnPv7dL8H-TYYGnVWkUeFoz-TcAAP__DstvLw">