Skip to content

clang-format: AlignAfterOpenBracket: BlockIndent leads to incomplete formatting #159562

@bersbersbers

Description

@bersbersbers
clang-format version 21.1.1

x.h:

void f(g) {
               YYYYYYYYYYYYYYYYYYYYY<XXXXXXXXX>(             //
            x,                             y
                                                        );
};

clang-format x.h --style="{AlignAfterOpenBracket: BlockIndent}":

void f(g) {
  YYYYYYYYYYYYYYYYYYYYY<XXXXXXXXX>(             //
            x,                             y
                                                        );
};

clang-format x.h:

void f(g) {
  YYYYYYYYYYYYYYYYYYYYY<XXXXXXXXX>( //
      x, y);
};

Note how x.h is only fully formatted without AlignAfterOpenBracket: BlockIndent (which is as I would expect it) but not with it (where I would have expected formatting as well).

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