Skip to content

[clang-format]: no break before closing bracket in array initialization #55485

Open
@igagis

Description

@igagis

to reproduce

.clang-format:

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

...

main.cpp:

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

	my_class a{//
		10,
		20
	};
}

expected result

Formatting is not changed.

actual result

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

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

version

$ clang-format --version
Debian clang-format version 15.0.0-++20220513071846+693758b28295-1~exp1~20220513071937.249

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions