<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/144560>144560</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[clang-format] Inconsistent formatting for the last element of an initializer list with `AlignAfterOpenBracket: BlockIndent` in clang-format-20
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang-format
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
vient
</td>
</tr>
</table>
<pre>
Test case - both elements are identical
```cpp
auto _ = {
{"a",
[]() {
return looooooooooooooooooooooooooooooooooooooooooooooooooong_fn();
}},
{"a",
[]() {
return looooooooooooooooooooooooooooooooooooooooooooooooooong_fn();
}},
}
```
clang-format-19
```
$ clang-format-19 -style="{AlignAfterOpenBracket: BlockIndent}" test.cpp
auto _ = {
{"a",
[]() {
return looooooooooooooooooooooooooooooooooooooooooooooooooong_fn();
}},
{"a",
[]() {
return looooooooooooooooooooooooooooooooooooooooooooooooooong_fn();
}},
}
```
clang-format-20 - note that second element got lambda start placed on the same line as `"a"`
```
$ clang-format-20 -style="{AlignAfterOpenBracket: BlockIndent}" test.cpp
auto _ = {
{"a",
[]() {
return looooooooooooooooooooooooooooooooooooooooooooooooooong_fn();
}},
{"a", []() {
return looooooooooooooooooooooooooooooooooooooooooooooooooong_fn();
}},
}
```
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJzklU1vnDAQhn-NuYxYGfO1HDiwRSvl1Evv0WAGcGPsFR5Spb--gk3TZKVW7aUf6srSWtZ43pl3HgBDMKMjqkV-Enkb4cqTX-pHQ46jzvdP9QcKDBoDQQyd5wnI0kyOA-BCYHpybDRaIRtRyOvSl4uQDa7s4R5E2oIoT0I2ALDvlEKhlFDvtrOrrlBHoapXcQCwEK-LA-t__efG-8Fdc4r0JaUo223turv0bS170O-p500tZfvavWt12qIb48EvM3KcVLcBKoObCIgDP1kSabs1VJ4aa0bXDEzL-wu504L6gVikDZys1w93bhvcXoICpsCH7w3tT7r0b09NSYjBeSbgCRkCae_6r48PjJ7B4tz1CIFxYbhY1NSDd8ATQcCZwBpHgAG2_M89X5V-hMIm-x-i8BcwEPV12ldphRHVSZnLpCyLLIumukhySgs86qHIykGrIxVZmeXDEZNMZ2kVmVpJlcsiKZNClSo9yKGqjpRK1FR0aVmJTNKMxh6sfZwPfhkjE8JKdZJleSEjix3ZsL_ElXpNw-ZN3kZLvd2Lu3UMIpPWBA7fMrFhu38A3lzMW7hz2rtgAm-8Xo_ZuHHb7oxaDPzCsx8AHRhn2KA1n2mBTQY-GZ42fn-KwUKCcbc0R-ti64n5EkTaCHUW6jwantbuoP0s1Hnr4_kvviz-I2kW6rzbE4Q6Pzv0WKsvAQAA___MhB1I">