<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/63562>63562</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Clang frontend C++ crash when initializing a large vector
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
brutalsavage
</td>
</tr>
</table>
<pre>
To quickly reproduce: https://gcc.godbolt.org/z/ssGz6Yna8 (assertion-trunk)
```cpp
#include <vector>
// a different number such as 10995116277000 doesn't crash
std::vector<int> v(1099511627777, 0);
```
Compiling the above code crashes clang `clang++ -x c++ --std=c++20 `, crashes locally using clang-17.0 (a10019a), also on trunk with assertion (see godbolt link)
Note that not all large numbers can lead to compiler crash. A number 10995116277000 which is larger compiles successfully. Additionally, this crash doesn't seem to happen without --std=c++20 or above as shown in the godbolt link.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJxsU8uSqzYQ_Rqx6TIlGpvHgoXHc51dVtlkKaQ2KFeWHLWwM_P1KWFcmUxSRYEA6Tz6dCtmO3miQRzexOG9UEuaQxzGuCTlWN3VRMUYzMfwW4A_F6t_ug-IdIvBLJpEfYQ5pRuL-ijwLPA8aV1OwYzBpTLESeD5U-CZ-ZfP5nevOhDYKWaKyQa_S3HxPwX2Qr4LedzujXxe-nbbvmBtvXaLIRD16U46hSjqH_86tHKDAmMvF4rkE_jlOlIEXvQMiqGSfX-oqgbbVkoJJhB7gW0CHRXPTxROJvuojy-Ok_VJ1D_gLrD7AtC2Ak8gs_D6Db7J_irrFK4366yfIM0Eagx3Ah0MPUmJQTvlJ8hm80Lgm8A32P0F-rXcrZret3eUeW8mfwG4oJVzH7BwZllRdlVbyrXOlZRVr7JMPIFyHCB4WGsOD5tyWbYg8m4mgi04cPY_sfwaEkGaVQIfEijnwKk40VZmBq08OFIGUgC92qb4VFkCHF9pfEsBHrPVM1h-gsXXSc6xaWK-LM59lHA0xmad2Wr2kmbLT_AvQTLRNbPP6nYjvzoMS_qfEoa4RaEYeA4PD9avAX21XxZmqE1f96qgoWq6tuvrpu6LeeibQ4vdHvtuHC9GHbq21k0vDWFTd2jawg4osZYNtlWPsu5LtcdWGb0_jAesUCuxl3RV1pXO3a95SgrLvNDQ1IcGC6dGcryOI6KnB6w_BWKezjjkM7txmVjspbOc-B-UZJOj4bT21CUGn8gbOG2t9CzXY6Zs1yarnP3MPaO2IJ89XyzRDd8m2qZ5GUsdrgLPmWt77G4x_EE6CTyvClngeXXwdwAAAP__qFVaOA">