<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/54350>54350</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
clang-format crashes on invalid C++ code with requires
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang-format,
crash
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
owenca
</td>
</tr>
</table>
<pre>
clang-format crashes when formatting `clang/test/Parser/cxx2a-concepts-requires-expr.cpp`, which can be reduced to a single line (of _invalid_ C++ code) as shown below:
```
~$ ls .clang-format
ls: .clang-format: No such file or directory
~$ ./clang-format -version
clang-format version 15.0.0 (https://github.com/llvm/llvm-project 9f616a467fc710f084b7e57812a2ed64c214c2c6)
~$ ./clang-format
bool r10 = requires (struct new_struct { int x; } s) { requires true; };
Assertion failed: ((!TypeIsFinalized || T == Type) && "Please use overwriteFixedType to change a fixed type."), function setType, file FormatToken.h, line 351.
...
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyVU8Fu2zAM_Rr5QsSQ5dhODj60yQLsMvTQeyHLdKxNlTJJbtJ9_Sg77ZpiGDCAhixSIt97pDrXv7bKSHtcDc4_ywjKyzBigPOIFhZf1PYIrObzOSYOEUOk5UH6gJ5-1OUi5Eo5q_AUw8rjz0l7DCu8nHyuTie6ysSOMmo1gpIWOgSP_aSwh-hAQqACBsFoi8DExg3wpO2LNLp_gh0T92SgXI9MbEEGCKM7pyTGnVl5x_ie8btUY7Fl23xhYg0mQP6R3RI0ga59CpDjm4MwEcJBExbnoScSKjr_epMyT4Q_CrZ6QR-0s8upm9A1AkWV85wnamOMp1SdkpAddRynLlfumTbGvLwtq5N336k2bIe6qOW6bgbVFHzgm3XXYNVsCiEF9vVaiYI-VZMw_wS5BDvnDPiCgJR7eOtSQhWin6iaxfPT9Zc196BthAsr72mzh5C0T973e3QQr1Falgp3gSYiJsqDJBX7JCvln614fD3h13DQlhr7i1rPmh0ZPCY4CVGKz1UE8alpEQ8GZUCY6HOk5dnriAd9wT4dTaOjRuKINEFD8kIkN1EXSQ4auGGyagYTMC7Jd0tzD7Moj-4H2nxM3nnyyqrIFxp5nn-aqqxvy35bbmUWdTT49ydDla5jezO1cKY2v-uWTd60_zcGtNUhTEg9OFTrsuLZ2G43ZSfWdV80vChFX8qhqCpZlGooeY1NlRlJDyS0rCIc4mYWkj67JO-MO22rfaZbwYXgZSEKKiCavOmxwWG75SUOTddztub4TE3NE7Lc-WPm2xlkNx0DBY0OMfwJyhD00SLOACi_nOLofOvOaJXMZjrtzOU32vtpRw">