<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=http://email.email.llvm.org/c/eJzdVUuP2yAQ_jX2BcWyIU7igw95KNutqvbQQ48VNmObCsMKcKL013ewk91Nm1W1alWtaiEC84L5vmFSGXEq7-QBdJTuonR9nhfpNOqIbsIYpQcjBWmMiegqogWJlmc5wa822nlSd9xGdI1GtufeRfkmyneERGw3WlMa0Xyct0-eL38X-7NLEOxxEGd6wAP7HrR_TZzNLGL7eZKLIHiFH5vNE4ar5rVXz_KELyCsl7uI_YKW1B7Xeuj3E1wjTk5-B4MnrS4YBqRD0hf5GWOUP4YM4a95m7a14rqdTYFIxshRKkUerBFDDRFbvznG_xLh_57vt0H3R-MhwOY76YiQTQPWkcaanlwXAk3SJCPHTtYdQUunZNt5dSIVeA-WVIMnzodSkbo21kLtk-el8g4sHrN0eA6Qr1ehBwcCvUYNr8zhxSo78V5NotlsNi02HJ0_6c_-pIIbuTOmxdWo2xo19PqD7KUPqiw9Z3yvBZbEFyl8F-TzSbrGhPQWMYd68Nja1s6hIBSPC1bPNLftd4BJWe4lim46JElyk4D7hpzMcKlUYhDIgMTP8cN7UVKDC1BdARjYOwJpAR_WhDyahBTHy0zcDhPwXJ1zItJD7wi3-ET44KRuwxOvFAqT37_w_wn-aY5FyUTBCh7zwXfGlu9Np7eMxoNVZef9Qwg6NZZWIpxVgnzhRqnD5WeGAH5D8HErnRsAX-U-p0U2j7tyzpYAGVtlzSqluVjkYsWgaRZ8NS8Wy0rEilegXBk6IaUajmQMEbpCvov__AaypCnNMoqbRU6zImF1AVXDCsGKjAEsonkKPZcqCXESY9vYlmPIamgdKpV03j0p-cgOQDm17thLr6BcP1aXacb2dSaA8EcyCdeCiGdcjeU3FvWN2g1_ENhV7FB7F48plWM-PwC6qmTo>52914</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Alignment of consecutive assignment and declarations causes incorrect indentation for structs
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
JohnC32
</td>
</tr>
</table>
<pre>
Given
```c++
void foo() {
const char* formats[] = {"%",
"%%", // some comment
"%+-?4.5d"
"%#-4.3%f",
"%15.a6e"};
const int numFormats = sizeof(formats) / sizeof(char*);
}
```
clang-format 13 will produce:
```c++
void foo() {
const char* formats[] = {"%",
"%%", // some comment
"%+-?4.5d"
"%#-4.3%f",
"%15.a6e"};
const int numFormats = sizeof(formats) / sizeof(char*);
}
```
Note, this differs from clang-format 12.0.1 which is slightly better but still incorrect.
Here's the _clang-format used in the above:
```yaml
---
BasedOnStyle: Google
ColumnLimit: 100
IndentWidth: 4
AlignConsecutiveAssignments: Consecutive
AlignConsecutiveDeclarations: Consecutive
...
```
If you comment out the AlignConsecutive* lines in _clang-format, we get correct indentation, thus the alignment items are causing problems.
```c++
---
BasedOnStyle: Google
ColumnLimit: 100
IndentWidth: 4
AlignConsecutiveAssignments: Consecutive
AlignConsecutiveDeclarations: Consecutive
...
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzdVFtvmzAU_jXwYgWBDWl54CEXpes0bQ972ONk8AE8GbuyTaLs1-8YkrbpUk2Vpqkasox97v7OpTbiWN3JPego3Ubp6rQv03k1EV2HNVH3RgrSGhPR24iWJLo50Ql-jdHOk6bnNqIrFLID9y4q1lGxJSRi20ma0ogW07550nz9O8ufVAJhh4s4MwA6HAbQ_i121ouI7fKkEIHwBj22yBOGp_atoWdFwpcQzjfbiP2GltQez3ocdjNcE05O_gSDnm7PGAakw6PP9BPGSH80Gcxf5m2-NorrbjEbIhkjB6kUebBGjA1EbPXuMv6XEv7v8_0-0v3ZeAiw-V46ImTbgnWktWYgl4VAkzTJyKGXTU9Q0inZ9V4dSQ3egyX16InzoVSkboy10Pjkeal8AItubhz6AfL9wvToQKDWxOG12b9aZUc-qJm0WCzmw5qj8hf91R9VUCN3xnR4mngbo8ZBf5KD9IGVpacX32uBJfFNCt8Hej5TV_ggvUHMoRk9jraVc0gIxeOC1DPOdfkt4KMs9xJJVxWSJLmagPuWHM14rlRiEMiAxEv7oV-U1OACVBcAhuwdgHSAjTUjjyLhiVMwc27HGXiuTm8i0sPgCLfYInx0UnehxWuFxOTPHf4_wT_vsaiYKFnJYy-9gmr1CJRpp0482SL8MS7CtSDimdsJySk_V9IQZh02iB0b7-LRqqr3_iFEOk-rTmKO6gSLAC9K7c-_BWblB5rCq3RuBGz1XUHLLI_7qm7EbUlzWqY1TSm0tMkZ52mW5gLaFEUUr0G5KoxXSjUcyGQijJpiG8sKlbKMorFlQbMyYU0JdctKwcqMASyjPIWBS5WEOBJju9hWU0j12DlkKum8e2LOwABU8zSP-eh7Y6uPptcbRuPJdTWF_gusa09v">