| Issue |
76803
|
| Summary |
clang-format-18 `AlignArrayOfStructures: Left` breaks constructor member initializer list indentation
|
| Labels |
clang-format
|
| Assignees |
|
| Reporter |
MartinsSmirnovs
|
Given following `.clang-format` file:
```yaml
AlignArrayOfStructures: Left
IndentWidth: 4
```
And following `foo.cpp` file:
```cpp
#include <map>
struct Foo {
explicit Foo()
: data({
{1, 2},
}) {}
const std::map<int, int> data;
};
```
I expect that clang-format foo.cpp will not perform formatting, however, it does and sets incorrect indentation of member closing bracket:
```cpp
#include <map>
struct Foo {
explicit Foo()
: data({
{1, 2},
}) {}
const std::map<int, int> data;
};
```
If `AlignArrayOfStructures: Left` gets commented out then everything works as expected.
`clang-format` version:
```
$ clang-format --version
Ubuntu clang-format version 18.0.0 (++20231208042253+5fc76e6b6da7-1~exp1~20231208042409.1357)
```
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs