Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
mkurdej opened this issue Jan 31, 2022 · 2 comments
Labels
bug Indicates an unexpected problem or unintended behavior clang-format

Comments

@mkurdej
Copy link
Member

mkurdej commented Jan 31, 2022

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);
@mkurdej mkurdej added bug Indicates an unexpected problem or unintended behavior clang-format labels Jan 31, 2022
@llvmbot
Copy link
Collaborator

llvmbot commented Jan 31, 2022

@llvm/issue-subscribers-clang-format

@llvmbot
Copy link
Collaborator

llvmbot commented Jan 31, 2022

@llvm/issue-subscribers-bug

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Indicates an unexpected problem or unintended behavior clang-format
Projects
None yet
Development

No branches or pull requests

2 participants