[PATCH] D126132: [clang-format] Fix a crash on lambda trailing return type

Owen Pan via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon May 23 14:16:01 PDT 2022


owenpan added a comment.

In D126132#3531643 <https://reviews.llvm.org/D126132#3531643>, @MyDeveloperDay wrote:

> 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. :)



================
Comment at: clang/lib/Format/TokenAnnotator.cpp:1189
+      if (Tok->isNot(TT_LambdaArrow) && Tok->Previous &&
+          Tok->Previous->is(tok::kw_noexcept))
         Tok->setType(TT_TrailingReturnArrow);
----------------
Ironically, I forgot to add the braces! This was caught and fixed by `InsertBraces` in D126157, though.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D126132/new/

https://reviews.llvm.org/D126132



More information about the cfe-commits mailing list