Issue 138151
Summary [clang-format] AlignArrayOfStructures With Tabs
Labels
Assignees
Reporter GMeulendyks
    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
```
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to