<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/62904>62904</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
clang-format poor spacing with braces initializer
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
cmcqueen
</td>
</tr>
</table>
<pre>
`test.c` containing:
```
static const CMD_HANDLER_T command_handlers[] =
{
{ "a", HandleA },
{ "bb", HandleBB },
{ "ccc", HandleCCC },
{ NULL, NULL },
};
```
Command:
clang-format -style="{ SpacesInParentheses: true, AlignArrayOfStructures: Left }" test.c > test.out.c
Result:
```
static const CMD_HANDLER_T command_handlers[] = {
{"a", HandleA },
{ "bb", HandleBB },
{ "ccc", HandleCCC},
{ NULL, NULL },
};
```
Anomalous things:
* For the first row only, there is no space between the opening brace and the first value.
* For the row with the widest last value, there is no space between the last value and the closing brace.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyslFFv4jgQxz-N8zICmUmA5iEPAYp6Etc7tXfPlZNMEq8cm7WdIvbTr5y0FCiraqVFyNh4_vMfzy-OcE42mihj8xWbbyLR-9bYrOzK7z2RjgpTHTO24J6cn5ZswaE02guppW5YnDO-YTxnC_72HZbOCy_LEOg8rP_evDzkj5vd_dPLf1CarhO6emmFrhRZN7oCizdvmZarcQIAwJarMCIKhshwDWefhyFBDmy5Ybi-oSmKT6JRs1qd57mlZ4hlWV7LR_V6vf5CDfD4_2536Rz-uQgO83h1s3vjuB4b9dHik0ephG4mtbGd8DBx_qgotA8xmD_vRUnuL_2vsKR9S44ci3PwtqdQUa5ko3NrxfGf-tnbvvS9HSN2VPuxQoSRNbD4fpyaPqA_K-OJXK_8VW1_4iGAa_6X8N-h_4raifmJ9Jd4T1RvRZ5A_j6_XJtOKNM78K3UjbtuFuawNRZ8S1BL6zxYcwCj1TH4-ZYsgXSgDbhAFAryByI9xJs9hdsHhQ07QldnWV6F6mn62SNkP0jfDouDrMh5UOJd8LXnR-zJsFTGncqYRlUWV2mcioiy2eIuSXkaL9OozdIkXtRJsaQaZ_UMq4qQL6saY5zN0jTmkcyQY8znmPAF4jyd3hUx53GS8vkMZ8UyZQmnTkg1Veq1mxrbRNK5nrIFpjyJlChIueH1hajpAMNmoDvfRDYLmknRN44lXEnn3UcWL72i7OI67Y2xw-nDwYZ-DadzILX0Uij5g2zUW5W13u8HprhluG2kb_tiWpqO4Tbkf_uZ7K35RqVnuB2qcgy3Q9U_AwAA__9qIYwm">