Issue |
133135
|
Summary |
BreakBeforeBraces: GNU should break before open brace of lambda
|
Labels |
new issue
|
Assignees |
|
Reporter |
tromey
|
I work on a GNU-style code base that uses C++. My test config uses `BreakBeforeBraces: GNU` because it seems impossible to replicate real GNU-style behavior with `BreakBeforeBraces: Custom` (in particular conditionally applying `IndentBraces`).
I think this setting should cause a line break before the `{` of a lambda.
Test code:
```
int f(int y) {
auto x = [&]() {
for (int i = 0; i < y; ++i)
return 97;
};
return x();
}
```
`clang-format` config:
```
BreakBeforeBraces: GNU
```
Actual output:
```
int f(int y)
{
auto x = [&]() {
for (int i = 0; i < y; ++i)
return 97;
};
return x();
}
```
Expected output:
```
int f(int y)
{
auto x = [&]()
{
for (int i = 0; i < y; ++i)
return 97;
};
return x();
}
```
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs