[PATCH] D115647: [clang-format] FixNamespaceComments does not understand namespace aliases

Owen Pan via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Dec 13 15:05:42 PST 2021


owenpan added inline comments.


================
Comment at: clang/lib/Format/NamespaceEndCommentsFixer.cpp:185-189
+      const FormatToken *Previous = AnnotatedLines[StartLineIndex - 1]->Last;
+      while (Previous && Previous->is(tok::comment)) {
+        Previous = Previous->Previous;
+      }
+      if (Previous && Previous->is(tok::semi))
----------------
Something like below will do:
`  if (AnnotatedLines[StartLineIndex - 1]->endsWith(tok::semi))`


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

https://reviews.llvm.org/D115647



More information about the cfe-commits mailing list