Skip to content

[clang-format] AlignConsecutiveAssignments breaks formatting of continued functions #53497

Open
@mkurdej

Description

Related to #52772.

Given:

BasedOnStyle: LLVM
AlignConsecutiveAssignments: Consecutive
ColumnLimit: 50 # just for the ease of reproduce

The code:

auto b = f(aaaaaaaaaaaaaaaaaaaaaaaaa,
           ccc ? aaaaa : bbbbb,
           dddddddddddddddddddddddddd);

is formatted correctly.

However, this one, with alignment on the assignment:

auto aaaaaaaaaaaa = f();
auto b            = f(aaaaaaaaaaaaaaaaaaaaaaaaa,
           ccc ? aaaaa : bbbbb,
                      dddddddddddddddddddddddddd);

has its last line being aligned with the opening parenthesis.

Expected formatting (not sure about the indentation of the last two lines though):

auto aaaaaaaaaaaa = f();
auto b            = f(aaaaaaaaaaaaaaaaaaaaaaaaa,
           ccc ? aaaaa : bbbbb,
           dddddddddddddddddddddddddd);

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions