<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/77302>77302</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[clang-format] Brace misplacement for Allman on an array of structs (17.06)
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang-format
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
dertarr
</td>
</tr>
</table>
<pre>
Hello. Started using `clang-format` version `17.06` and noticed several strange issues. Here is one of them:
Brace is misplaced with `BreakBeforeBraces: Allman` setting for an array of structs.
Here is the source code:
```
// AlignArrayOfStructures: Right
static const Point_t s_pointArray[] =
{
{ -45, 478},
{ 0, 74},
{5854467, -35478}
};
```
And the style file:
```
---
Language: Cpp
BasedOnStyle: Google
AlignArrayOfStructures: Right
BreakBeforeBraces: Allman
...
```
The `clang-format` utility tries to put the brace after the assignment for some reason. Here is the output:
```
// AlignArrayOfStructures: Right
static const Point_t s_pointArray[] = {
{ -45, 478},
{ 0, 74},
{5854467, -35478}
};
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJysVF2vozYQ_TXmZQQyBgJ54CG5UboPlbbq7fvK4AHcGhvZw63y7ysD22jV9EvaKAI7c3xmPHNyZAh6tIgtq66suiVypcn5VqEn6X3SOfVoP6ExLoN3kp5QwRq0HYGdeG-kHdPB-VkSO3H4QB-0szGU1xk_xd-kVWAd6R4VBPxALw0E8tKOCDqEFUMGn9DHDTiL4AagCWdWXBi_MX48r172G2TWYTEykv2uaYqZrh7lb1ccnMcNFVhxgYsxs7Qxf0CiWO7gPEgL0nv5iEkC-bWnkO38XyugCSG41fcIvVP4rOLEj---FXcm7gAXo0d7iZSfh_eNcPV7AT_rcaIdHEiS7qF3NhD85LSlLwThyxJX29m988CK28FeX_cFAACrr_GVlhUTb3FV1g2rb0y8_QUDwCOmLl_Eq6Yqy1Md42lRHRxHthsrri-vebFq7wg9DMKgzd82JE3TffGjtOMqxwiEt2U5picDqs_2PdLEwA_OjQaPHP-lhf804w2QZdnrQW3PXyZ8JdeVtNH0APIaA5CDZaXtvt2mNjkQ-m2__0dmtLTJKLgZwaMMzj61G3FupWWlfxHN99YMPOXy_7USP99DL4lqC3UuzjLBNq95WedNWebJ1A7nShVNJ1RTSa7UcDrXasBz1w-qkEIUiW4FFyXPeZOLqqjqTFUqL5qukyovBJcVKznOUpvMmI85c35MNtto67rgIjGyQxM28xLimwELEe3Mt_FY2q1jYCU3OlB4EpEmsxnfNwerG-x289Vr_hz8rjhw9pWTABPN7nrinKzetBPREue6z33UNK1d1ruZiXus4Hili3e_Yk9M3Hc7ZOK-Xe2PAAAA__8p8KYZ">