This is an archive of the discontinued LLVM Phabricator instance.

[clang-format] Fix a crash on lambda trailing return type
ClosedPublic

Authored by owenpan on May 21 2022, 3:57 PM.

Diff Detail

Event Timeline

owenpan created this revision.May 21 2022, 3:57 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 21 2022, 3:57 PM
owenpan requested review of this revision.May 21 2022, 3:57 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 21 2022, 3:57 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript
curdeius accepted this revision.May 22 2022, 12:16 AM

LGTM. It seems it has landed already.

This revision is now accepted and ready to land.May 22 2022, 12:16 AM

LGTM. It seems it has landed already.

Yeah. I pushed it by mistake. :(

MyDeveloperDay accepted this revision.May 23 2022, 8:51 AM

LGTM (sorry I've been slow on the reviews, my day job keeps getting in the way ;-))

LGTM (sorry I've been slow on the reviews, my day job keeps getting in the way ;-))

Np! It's really that @curdeius and @HazardyKnusperkeks are fast. :)

clang/lib/Format/TokenAnnotator.cpp
1189

Ironically, I forgot to add the braces! This was caught and fixed by InsertBraces in D126157, though.

@HazardyKnusperkeks I think you know this better than any of us as you added the assertion to setType(). Does this look ok to you?

@HazardyKnusperkeks I think you know this better than any of us as you added the assertion to setType(). Does this look ok to you?

This looks good.
One should define what is the difference between TT_LambdaArrow and TT_TrailingReturnArrow. But if there is a difference, then the lambda arrows should stay TT_LambdaArrow, right?

LGTM (sorry I've been slow on the reviews, my day job keeps getting in the way ;-))

Same here, I'm just starting to catch up the last weeks. :)

One should define what is the difference between TT_LambdaArrow and TT_TrailingReturnArrow. But if there is a difference, then the lambda arrows should stay TT_LambdaArrow, right?

It seems there is no difference. See https://github.com/llvm/llvm-project/pull/70519.