Closed
Description
Bugzilla Link | 45141 |
Version | 10.0 |
OS | Linux |
CC | @mkurdej,@emmenlau |
Extended Description
clang-format is unable to correctly format code like this:
func(0, [] {}, 0);
It will format it into:
func(
0, [] {}, 0);
Shortest example code that reproduces it:
void f()
{
func(0, [] {}, 0);
}
The clang-format invocation can be the simplest possible. Just "clang-format test.cpp" without any .clang-format input file and no arguments.
Metadata
Metadata
Assignees
Type
Projects
Milestone
Relationships
Development
No branches or pull requests
Activity
llvmbot commentedon Jul 13, 2020
It only happens when the lambda is neither the first nor the last argument.
mkurdej commentedon Sep 22, 2020
That's a regression between clang-format 7(.1) and 8.
mkurdej commentedon Sep 22, 2020
This behaviour was caused by commit 5528cac ([clang-format] tweaked another case of lambda formatting). Reverting this commit makes the testcases from this PR pass.
The mentioned commit introduced an aggressive way of breaking lines when lambda is not the last arguments.
[clang-format] Fix a bug that wraps before function arguments