Skip to content

[clang-format] Cannot break blocks properly #87484

Closed
@hermesonbf

Description

@hermesonbf

In my code I want to write this:

{
  cout << "test";
}

But clang-format formats to this:

{ cout << "test"; }

If I set BraceWrapping: AfterFunction = true, then it formats like the first, but this should not happen because this is not a function and this option refers to a function, I want to break only the indentation blocks with a single line of code inside without affecting everything else, if I set ColumnLimit = 0 then it also formats like the first but then it does not allow me to define variables with attributes in a single line.

Metadata

Metadata

Assignees

Labels

bugIndicates an unexpected problem or unintended behaviorclang-format

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions