An unexpected line break is added inside lambda.
Tested with 1TBS and K&R style.
Code block:
int main()
{
const int a = 10;
const int b = [&] {
if (a) {
return 0;
} else {
return 10;
}
}();
return b;
}
Astyle will add a line break between the if/else and {, resulting in:
const int b = [&] {
if (a)
{
return 0;
} else
{
return 10;
}
}();
I've ran astyle with the following options:
$ ./astyle-3.4-x64/astyle.exe --version
Artistic Style Version 3.4
$ ./astyle-3.4-x64/astyle.exe --style=kr example_lambda.cpp
Hi, thanks for reporting. There is a fix in the git repo which you can try til the next release.
Fixed in version 3.4.6
Thank you for the fix.
It is working fine for me.