The previous implementation of the option involved a hack which corrupted the parenthesis state stack. The review for the previous implementation is here: https://reviews.llvm.org/D102706
Specifically, this change fixes the following github issues:
- LambdaBodyIndentation for lambda as argument argument
- clang-format 13.0.0: LambdaBodyIndentation: OuterScope closing brace & parenthesis too indented
- Inconsistent indentation closing bracket of the lambda body
- clang-format LambdaBodyIndentation=OuterScope doesn't work correctly with BraceWrapping.BeforeLambdaBody=1
This is my first contribution to clang/clang-format, so I'd appreciate some guidance.
One thing that I'd specifically like some guidance on is which version to ship these changes in and how. Although I would consider all the changes here to be bugfixes, they do considerably change the behaviour of the OuterScope option in question, so I'm not sure whether these changes are suitable to go into a patch release or if they should only go into the next major release.
This code may come from Format.h