A left square can start a lambda only if it's not preceded by an identifier other than return and co-wait/co-yield/co-return.
Fixes https://github.com/llvm/llvm-project/issues/54245.
Fixes https://github.com/llvm/llvm-project/issues/61786.
Paths
| Differential D147295
[clang-format] Don't misannotate left squares as lambda introducers ClosedPublic Authored by owenpan on Mar 30 2023, 8:33 PM.
Details Summary A left square can start a lambda only if it's not preceded by an identifier other than return and co-wait/co-yield/co-return. Fixes https://github.com/llvm/llvm-project/issues/54245.
Diff Detail
Event TimelineHerald added projects: Restricted Project, Restricted Project, Restricted Project. · View Herald TranscriptMar 30 2023, 8:33 PM This revision is now accepted and ready to land.Mar 30 2023, 9:22 PM This revision was landed with ongoing or failed builds.Mar 31 2023, 4:13 PM Closed by commit rG2a42a7b4e873: [clang-format] Don't misannotate left squares as lambda introducers (authored by owenpan). · Explain Why This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 510143 clang/lib/Format/UnwrappedLineParser.cpp
clang/unittests/Format/TokenAnnotatorTest.cpp
|