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] AlignAfterOpenBracket AlwaysBreak does not keep to the ColumnLimit #49670

Closed
mydeveloperday opened this issue May 13, 2021 · 7 comments
Labels
bugzilla Issues migrated from bugzilla clang-format

Comments

@mydeveloperday
Copy link
Contributor

Bugzilla Link 50326
Resolution FIXED
Resolved on Jun 03, 2021 23:25
Version 12.0
OS Windows NT
Blocks #48661
CC @tstellar
Fixed by commit(s) eae445f e673593

Extended Description

With a .clang-format of

Language: Cpp
BasedOnStyle: LLVM
AlignAfterOpenBracket: AlwaysBreak
...

The follow file does not break the last line (foo4) at the ColumnLimit


void bar()
{
size_t foo1 = function(Foooo, Barrrrr, Foooo, Barrrr, FoooooooooLooooong);

size_t foo2 = function(
    Foooo, Barrrrr, Foooo, Barrrr, FoooooooooLooooong, BarrrrrrrrrrrrLong,
    FoooooooooLooooong);

size_t foo3 = (*(function))(Foooo, Barrrrr, Foooo, FoooooooooLooooong);

size_t foo4 = (*(
    function))(Foooo, Barrrrr, Foooo, Barrrr, FoooooooooLooooong, BarrrrrrrrrrrrLong, FoooooooooLooooong);

}

It fees like the correct should be


void bar()
{
size_t foo = function(Foooo, Barrrrr, Foooo, Barrrr, FoooooooooLooooong);

size_t foo = function(
    Foooo, Barrrrr, Foooo, Barrrr, FoooooooooLooooong, BarrrrrrrrrrrrLong,
    FoooooooooLooooong);

size_t foo = (*(function))(Foooo, Barrrrr, Foooo, FoooooooooLooooong);

size_t foo = (*(
    function))(Foooo, Barrrrr, Foooo, Barrrr, FoooooooooLooooong,
    BarrrrrrrrrrrrLong, FoooooooooLooooong);

}

@mydeveloperday
Copy link
Contributor Author

Present in clang-12 seems like a regression

v8 was

void bar() {
size_t foo = function(Foooo, Barrrrr, Foooo, Barrrr, FoooooooooLooooong);

size_t foo = function(
Foooo, Barrrrr, Foooo, Barrrr, FoooooooooLooooong, BarrrrrrrrrrrrLong,
FoooooooooLooooong);

size_t foo = (*(function))(Foooo, Barrrrr, Foooo, FoooooooooLooooong);

size_t foo = (*(function))(
Foooo, Barrrrr, Foooo, Barrrr, FoooooooooLooooong, BarrrrrrrrrrrrLong,
FoooooooooLooooong);
}

@mydeveloperday
Copy link
Contributor Author

Actually this is a version 11GA -> 12GA regression, as v11 is fine also

void bar() {
size_t foo = function(Foooo, Barrrrr, Foooo, Barrrr, FoooooooooLooooong);

size_t foo = function(
Foooo, Barrrrr, Foooo, Barrrr, FoooooooooLooooong, BarrrrrrrrrrrrLong,
FoooooooooLooooong);

size_t foo = (*(function))(Foooo, Barrrrr, Foooo, FoooooooooLooooong);

size_t foo = (*(function))(
Foooo, Barrrrr, Foooo, Barrrr, FoooooooooLooooong, BarrrrrrrrrrrrLong,
FoooooooooLooooong);
}

@mydeveloperday
Copy link
Contributor Author

This is caused by 5426b2f https://reviews.llvm.org/D93626

@mydeveloperday
Copy link
Contributor Author

Tentative fix https://reviews.llvm.org/D102392

@mydeveloperday
Copy link
Contributor Author

We should try and get this put into 12.0.1 as its not the first time this bug has been seen

@mydeveloperday
Copy link
Contributor Author

Tom I've marked this as Blocks "release-12.0.1" if you want to move that to something later like 12.0.2 that is completely fine.

@tstellar
Copy link
Collaborator

tstellar commented Jun 4, 2021

Merged: e673593

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 11, 2021
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugzilla Issues migrated from bugzilla clang-format
Projects
None yet
Development

No branches or pull requests

2 participants