<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/56111>56111</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
clang-format: adjacent template argument list delimiters `>>` cause QualifierAlignment:Right to break syntax
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
khuldraeseth
</td>
</tr>
</table>
<pre>
With `QualifierAlignment: Right`, this snippet is formatted incorrectly by clang-format 15.0.0 regardless of `SpacesInAngles`:
```cpp
foo<const Bar<Baz>>()
// turns into:
// foo< Bar<Baz> const >)
```
Similar problems arise when things other than parentheses follow the template argument list, with the first character always deleted. The spaces in the angle brackets only show up when what follows is an open parenthesis with a match or an open square bracket with a match.
Breaking up the `>>` with a space causes correct behavior. `foo<const Bar<Baz> >()` is formatted to `foo<Bar<Baz> const>()`.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJx1U01zmzAQ_TVw2QmDwZBw4GAnzUyPbTrT8wILUiJLVBJx3V_flUhqu01nNKCP3bdP7606M5za79ILSOr8y4JKjpLsTslJH0j7pNzBVzkJz6dJcQ9eSAdOy3kmDzwdjT2g9zSA1L2xlnqvTtCdoFeop5v1GDZVlmc5WJrQDoqcAzOGek8z9uQ-652eeDeUKHdJ_pDkuzCPo5_ndWc0Jinve6Odhz1anu_xV1J-CqO4S4rmLbF45AF-sdoxJ2_OkOvJinMFAStqRGr-qr8un-RBKrQwW9MpOjhAKx3BUZAOkuiJb-QFWV6ghhktSyfIURBIKXPkfQJPh1mhJ06eliAuKOl8UPUY9A8ho7RMpBdosfcMh-qIJwcDKWKNM_jGMS6KxneLGRikg47jX8gzC83yO8EVl3mldxRswMrCBceYn5npgiTvxfoIbFUvwNg_Me7HwlHv6Fdh2ZtO8bu3hC-sQigaSEUnozN1_p4VaUOPS1DlrVWgI4Gv0tgspPzPYThbzHBXTefNOfFfRy_zsnRoy6EpG0y99IraywYNXY7DMxNkUz62KXjATcCmuOvrxRvBhy8nPpzAsQv6gDtpjz_TxapWeD-70JmxJydWaOmy3hx4odTr---G2-2ZZeKldG7hF1I8VvVms0lFe1cU-W3dDEVfj3d93gxNVWEzjtthO9YD5qnCjpRrk2qfFIWmI0QInifVQyrbImeAetPk1bbMb7OSmrLqmqLu-qrc5nWyzemAUmWBR2bslNo2UuqWyfFhkMSdD9E5vjZRLMf4uHhhbPsiFjVY5IfgRRrrt5H_b393dCA">