Issue 55485
Summary [clang-format]: no break before closing bracket in array initialization
Labels new issue
Assignees
Reporter igagis
    # to reproduce

`.clang-format`:
```yaml
---
AlignAfterOpenBracket: BlockIndent
AlignArrayOfStructures: Right
BinPackArguments: 'false'
ColumnLimit: '120'
ContinuationIndentWidth: '1'
IndentWidth: '1'
Language: Cpp
Standard: Latest
TabWidth: '1'
UseCRLF: 'false'
UseTab: ForContinuationAndIndentation

...
```

`main.cpp`:
```cpp
void func(){
	int array = {//
		10,
		20
	};

	my_class a{//
		10,
		20
	};
}
```

# expected result

Formatting is not changed.

# actual result

```cpp
void func() {
	int array = {//
														10,
														20};

	my_class a{//
												10,
												20};
}
```
- there is not break before closing `};` bracket (`AlignAfterOpenBracket: BlockIndent`)
- indentation is weird

# version

```console
$ clang-format --version
Debian clang-format version 15.0.0-++20220513071846+693758b28295-1~exp1~20220513071937.249
```
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to