[PATCH] D138373: [clang-format] Don't eat two semicolons after namespace

Björn Schäpers via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jul 12 03:23:56 PDT 2023


This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
HazardyKnusperkeks marked an inline comment as done.
Closed by commit rGce7356f08194: [clang-format] Don't eat two semicolons after namespace (authored by HazardyKnusperkeks).

Changed prior to commit:
  https://reviews.llvm.org/D138373?vs=476724&id=539472#toc

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D138373

Files:
  clang/lib/Format/UnwrappedLineParser.cpp


Index: clang/lib/Format/UnwrappedLineParser.cpp
===================================================================
--- clang/lib/Format/UnwrappedLineParser.cpp
+++ clang/lib/Format/UnwrappedLineParser.cpp
@@ -2970,15 +2970,12 @@
     if (ManageWhitesmithsBraces)
       ++Line->Level;
 
+    // Munch the semicolon after a namespace. This is more common than one would
+    // think. Putting the semicolon into its own line is very ugly.
     parseBlock(/*MustBeDeclaration=*/true, AddLevels, /*MunchSemi=*/true,
                /*KeepBraces=*/true, /*IfKind=*/nullptr,
                ManageWhitesmithsBraces);
 
-    // Munch the semicolon after a namespace. This is more common than one would
-    // think. Putting the semicolon into its own line is very ugly.
-    if (FormatTok->is(tok::semi))
-      nextToken();
-
     addUnwrappedLine(AddLevels > 0 ? LineLevel::Remove : LineLevel::Keep);
 
     if (ManageWhitesmithsBraces)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D138373.539472.patch
Type: text/x-patch
Size: 935 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230712/ff0c7e7c/attachment.bin>


More information about the cfe-commits mailing list