[PATCH] D120503: [clang-format] Handle trailing comment for InsertBraces

Björn Schäpers via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Feb 24 12:47:22 PST 2022


HazardyKnusperkeks added inline comments.


================
Comment at: clang/lib/Format/UnwrappedLineParser.cpp:2340-2341
       if (!L.InPPDirective) {
         Tok = getLastNonComment(L);
-        if (Tok)
+        if (Tok) {
+          Tok = L.Tokens.back().Tok;
----------------
So basically one would just need a `Line.isComment()` or so? The `lastNonComment` is not important, right?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D120503



More information about the cfe-commits mailing list