This is an archive of the discontinued LLVM Phabricator instance.

[clang-format] Correctly annotate static and consteval lambdas
ClosedPublic

Authored by rymiel on Sep 24 2022, 7:32 AM.

Details

Summary

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

Diff Detail

Event Timeline

rymiel created this revision.Sep 24 2022, 7:32 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 24 2022, 7:32 AM
rymiel requested review of this revision.Sep 24 2022, 7:32 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 24 2022, 7:32 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
rymiel edited the summary of this revision. (Show Details)Sep 24 2022, 7:34 AM
rymiel added a project: Restricted Project.
This revision is now accepted and ready to land.Sep 24 2022, 9:14 AM

Fancy stuff.

owenpan accepted this revision.Sep 24 2022, 1:54 PM
This revision was landed with ongoing or failed builds.Sep 25 2022, 11:16 AM
This revision was automatically updated to reflect the committed changes.