[clang-format] Correctly annotate static and consteval lambdas
authorEmilia Dreamer <emilia@rymiel.space>
Sun, 25 Sep 2022 17:29:34 +0000 (20:29 +0300)
committerEmilia Dreamer <emilia@rymiel.space>
Sun, 25 Sep 2022 17:29:55 +0000 (20:29 +0300)
commit7847225576d571fb7101463de56330e1f0e84856
tree91d344540bb74675e3953462ff0dc01da86a469f
parentbcb1397bda667e75200ae0be9a65fd17dd0763d4
[clang-format] Correctly annotate static and consteval lambdas

`P1169` "static operator()" (https://wg21.link/P1169) is accepted to
C++23 and while clang itself doesn't exactly support it yet,
clang-format could quite easily.

This simply allows the keyword `static` to be a part of lambdas as
specified by the addition to [expr.prim.lambda.general]

While adding this, I noticed `consteval` lambdas also aren't handled,
so that keyword is now allowed to be a part of lambdas as well

Reviewed By: HazardyKnusperkeks, owenpan, MyDeveloperDay

Differential Revision: https://reviews.llvm.org/D134587
clang/lib/Format/UnwrappedLineParser.cpp
clang/unittests/Format/TokenAnnotatorTest.cpp