[clang-format] Annotate lambdas with requires clauses.
The C++ grammar allows lambdas to have a *requires-clause* in two places, either directly after the *template-parameter-list*, such as: `[] <typename T> requires foo<T> (T t) { ... };` Or, at the end of the *lambda-declarator* (before the lambda's body): `[] <typename T> (T t) requires foo<T> { ... };` Previously, these cases weren't handled at all, resulting in weird results. Note that this commit only handles token annotation, so the actual formatting still ends up suboptimal. This is mostly because I do not yet know how to approach making the requires clause formatting of lambdas match the formatting for functions. Fixes https://github.com/llvm/llvm-project/issues/61269 Reviewed By: HazardyKnusperkeks, owenpan Differential Revision: https://reviews.llvm.org/D145642
Loading
Please sign in to comment