[PATCH] D107907: [clang-format] handle trailing comments in function definition detection

Owen Pan via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Aug 11 12:09:58 PDT 2021


owenpan added inline comments.


================
Comment at: clang/lib/Format/TokenAnnotator.cpp:2484-2490
+  if (Next->Next && Next->Next->is(tok::identifier)) {
+    const FormatToken *Last = Line.Last;
+    if (Last && Last->is(tok::comment))
+      Last = Last->getPreviousNonComment();
+    if (Last && Last->isNot(tok::semi))
+      return true;
+  }
----------------
  if (Next->Next && Next->Next->is(tok::identifier) &&
      !Line.endsWith(tok::semi))
    return true;


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D107907



More information about the cfe-commits mailing list