<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/108778>108778</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Clang 17/18 crashes with segmentation fault on compiling valid code.
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
Alexey104
</td>
</tr>
</table>
<pre>
Compiling some code using C++20 features causes Clang 17.0.6/18.1.8 to crash with segmentation fault, while the same code compiles with Clang 16.0.6 or GCC. LLVM is obtained from ArchLinux repos via Pacman. Below is the minimal example I was managed to create to reproduce the issue:
[test.hpp.txt](https://github.com/user-attachments/files/17007478/test.hpp.txt)
[test.cpp.txt](https://github.com/user-attachments/files/17007479/test.cpp.txt)
[clang-output.txt](https://github.com/user-attachments/files/17007480/clang-output.txt)
[test-32f98a.cpp.txt](https://github.com/user-attachments/files/17007488/test-32f98a.cpp.txt)
[test-32f98a.sh.txt](https://github.com/user-attachments/files/17007489/test-32f98a.sh.txt)
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyslE-PmzAQxT-NuYyCjIEABw6brKgqbaWeeh9gAFcGI_9Jst--MgmqdlftKRf-SMz7zTz8Bq2V40JUs_zE8tcIvZu0qV8U3eg94VnU6v69Put5lUouI1g9E3S6J_A2vJ-ZODFxEhwGQucNWejQW7JwVriMkBQxj49MNEkZJ3EJTkNn0E5wlW4CS-NMi0Mn9QIDeuWYOMN1korATQQWd1q3dUD2XvfQPgZt0Aa-nc8xvL39-gHSgm4dyoV6GIye4cV005tc_A0MrdrCRSL8xG7GJYYTKX0NJYE1y0XOqIBuOK-K4Dtc0cKMC47U3_smdBSeDK1G9767Nymt9cTSF8ZfGd-v-cmRdfG0rrG7OZa_MlFOzq02fCgaJppRusm3cadnJhpvyRzQOeymYIhlohnCuMG4gvMiK0ommg-SovqI6p6GqnZU9xXVBecP2rvVu-fgSs5E80X203SHVAxVic8bstz9_Kz8D7CdnsStPnEfwjs26uu0r9IKI6qTQhyz9HhMs2iqszSp-rRocWhbavt-GPJkEEhlXqbU8yqSteAi41WSiyRL8ywuj1VJaV4Wbd4nWcZZxmlGqWKlLnOszRhtJ7dOeFkUZaSwJWW3PSDE9j-YEGElmDoUHFo_WpZxJa2zfyWcdIrqPetbzu8B36P6NeKgl0ecwwK5oJL9lvE48kbV_zE3QB-3w2r0b-ocE802xGbwfY5LLf4EAAD__7xBjH8">