<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/73902>73902</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
clang-format misindents field initializers inside range-based for initializer
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang-format
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
ilya-biryukov
</td>
</tr>
</table>
<pre>
Run clang-format on this code:
```cpp
void test() {
for (const TestCase& test_case : {
TestCase{
.a = 1,
.b = "1",
},
TestCase{
.a = 2,
.b = "2",
},
}) {}
}
```
In the output, the field names for the second fields are misindented:
```cpp
void test() {
for (const TestCase& test_case : {
TestCase{
.a = 1,
.b = "1",
},
TestCase{
.a = 2,
.b = "2",
},
}) {
}
}
```
I expect them to be at the same level of indent as the first field.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJy8lE-L2zAQxT-NfBli5NHajg8-7G4I9Fp6L7I1TtTKltHIodtPX_yn2U0b6NJCRSDWG0kPvd8gzWxPA1Et8ieRHxI9xbMPtXUvetfY8DJ99Zek8eal_jgN0Do9nHadD72O4AeIZ8vQekNCPQp5EPJRFHL9teO4KhdvDUTiKHAvsAJRPq0FAIDOBxC4b_3AET4Rx2fNJLBYNnxuNRMI9Xi7ZxvX1Xdq80g1CHWATODzVk-bRRGImUB81V-HKA_35N-ttsPvHrKYX63w_VaLtAZUHrY4rx8_c12nH-bsCfwUxykKfF5mnSVnYNA98RLsrDG1fjBriUEHgt6yHQwNkczfUfuvzG7DvOX2blp3TX6l8q_INvmP6DaAQN9GauMMqYfooSHQcUWmewJHF3LgO1hZgeYNceC40kwTUytTqUonVGelzBTuscyTcy3LrizarsxlaTr5IGVFpio6jUVhlDFFYmuUqLJMSVlmWZaneyUV7jOsmrwjZUg8SOq1dalzlz714ZRY5onqUlUSE6cbcry8GIhvn4Q5t_yQhHretmumE4sH6SxHfj0o2uiovnlIrh3JWwvbwUarnf1OgcEObA1B0MOJdo1mMksHvlmTTMHV5xhHnhsajwKPJxvPU5O2vhd4nL23v90Y_Bdqo8DjciMWeFwu9SMAAP__WvpbNA">