<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/138151>138151</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[clang-format] AlignArrayOfStructures With Tabs
</td>
</tr>
<tr>
<th>Labels</th>
<td>
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
GMeulendyks
</td>
</tr>
</table>
<pre>
Aligning an array of structures with `UseTab: AlignWithSpaces` does not format correctly.
Of note, switching to `UseTab: Never` does resolve the issue.
```
#define LONG_NAME 1
#define LONGER_NAME 2
#define THIS_IS_A_VERY_LONG_NAME 3
int i = 1 << 0;
int j = 1 << 1;
struct Foo
{
int a;
int b;
int c;
};
std::vector<Foo> foos = {
{LONG_NAME, 0, i | j},
{LONG_NAME, 0, i | j},
{LONGER_NAME, 0, i | j},
{LONGER_NAME, 0, i },
{THIS_IS_A_VERY_LONG_NAME, 0, j },
{LONGER_NAME, THIS_IS_A_VERY_LONG_NAME, i },
{LONG_NAME, THIS_IS_A_VERY_LONG_NAME, j }
};
```
Relevant .clang-format options:
```
---
Language: Cpp
BasedOnStyle: Google
AlignArrayOfStructures: Left
UseTab: AlignWithSpaces
IndentWidth: 4
TabWidth: 4
```
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJysVEtv8jgU_TXOxgI5cR6wyMK8OpX6FakwU80KOclNYsbEyHao-PcjJ0BJO3QzX3Sl6L7OObq2LzdGVA1AiqIZihYeb22tdPr0C1oJTXH-x3iZKs4pk6JqRFNh3mCuNT9jVWJjdZvbVoPBH8LWGMXkTwNbniHKcNfxLmy9OfIcDIoJLhQY3CiLS6UP3OJcaQ25lecxImxduhSgYI7Nh7B57disGoK-wgn0DUqDUfIE2NaAhTEtOBxnMbkYYSigBZSiAfyyfn3avbJfS-x_iy_f-kwwyGz_eN7snjc7tvtr-fb37hOA9jyisVhgRBfYx4jOEZ1jgujsktkPM36fQYT1Y8MrpZyf9NGpa-HXms7LBl5-8ZLFHVCBKEOUnSC3SiM6d5h0iUulTMd-Q0fJ7CYfBXMXuRr54vcmMErmeO_oXPo3Y1zm7Q77f7QOvsc4A4hHZ3qVgh98-69AP2n5ieSbokcz_QmkV3N_G-6vPGFvIOHEG4vHueRNNbo8OHW0QjXGXZphy2g0QoS98KZqeQXupc2PR0TYjBso1s3GnmUXfVKqktBzdA-cuV2wLje3TeCqXqC0iLDHu4Cw56aAxr6LwtauIESEbXk28G_6vCKlxZROuQepn4Sx79MwSbw6JbQspkFEw5jEBUzCOA9yOik4JNEEkqLwRBqQICIR8f2I-n44zqIpQB4HkORZGfkxCgkcuJBjKU-HsdKV1-2R1KcTP_I9yTOQ5robdeqqRllbGRQSKYw1n31WWNlt0fuBo2iB_3tM2E0Db3lmvFbLtLb22B1LsELBqhK2brNxrg4oWDmGy2901GoPuUXBqpNpULC6KD2lwb8BAAD__9ognTE">