<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/55265>55265</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
clagn-format AlignConsecutiveAssignments failure
</td>
</tr>
<tr>
<th>Labels</th>
<td>
bug,
clang-format
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
zmodem
</td>
</tr>
</table>
<pre>
Consider:
```
$ cat /tmp/a.cc
#if A
bool thisisalongvariablename = true;
#else
bool thisisalongvariablename = false;
#endif
#if B
bool shortervarname = true;
#else
bool shortervarname = false;
#endif
$ build.release/bin/clang-format -style="{AlignConsecutiveAssignments: true}" /tmp/a.cc
#if A
bool thisisalongvariablename = true;
#else
bool thisisalongvariablename = false;
#endif
#if B
bool shortervarname = true;
#else
bool shortervarname = false;
#endif
```
Note that the second initializer of shortervarname gets properly aligned, but not the first one.
I wasn't able to find a clang-format where this worked, so it doesn't seem to be a regression.
(Split out from https://github.com/llvm/llvm-project/issues/55161)
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzlU8GOmzAQ_RpzsYLAQAgHDslGK-1lL_0Cgwdwa-zIHhJlv74DSbbJqmoj9Vhk2djjefPmzbhx6ly_OBu0As-yLUv2LLnN6-Q6LluR81YiZ-IVxwPNMm7bmynTHb-6Nc4ZjoMOOkjjbH-UXsvGgJUjcJbtOfoJWLb7dAUT4EnXTs53732t0t0D6YXK7g4vDM4jeMJ6lsFvPJ4JnPNm0kbFHgxIui1eG21pbo20_apzfiT1VgHPhpD2TAhW7rZG93bWH9oJ9RG2IdDBCBYDVeNCtJzv_n-yf35_ZfClT5f53SFQTqQ4DsBJXmcV11ajlkZ_gOeu-xqwBwz84N0BvDlzOVcGFBMvVFbk1l2QOu0Dcmchvo_2xk8yUK1L5LNwHB1dpICSPxT_NICHRWl-cv7HBT04rpErB1eAADDOAA2Qu4feA_WEs_Gj3JtvB0Nujqh13o18QDzMLUMNQqPXOExN3LqRNsYcb8uK0vsOLdJWhzBBoJ-iSNcpE1Wk6kxVWSUj1GigJua9vTH_Q59SbbSZPESTN_W_0BDrIhrqspKJLNaqasUmT4tSJelGqbQja1JlxSYysqHGqVmxo2fRTP38kEhGWu61nk-LfaRrkQiRFEmeZpnIy7hJBJRlWZSwbltRVSxPYKQE4plX7Hwf-XqhSMiBjEYHDL-McskbYAlP-HJCaqL6Y3QKxmhJpl4y-QkBT6zd">