[PATCH] D146310: [clang-format] Fix dropped 'else' in 398cddf6acec

Jared Grubb via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Mar 17 10:34:56 PDT 2023


jaredgrubb created this revision.
jaredgrubb added a reviewer: klimek.
jaredgrubb added a project: clang-format.
Herald added a project: All.
jaredgrubb requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

A patch (398cddf6acec <https://reviews.llvm.org/rG398cddf6acecfb12b5997c2d639ee3cf31b787ad>) appears to have inadvertently removed an `else`.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D146310

Files:
  clang/lib/Format/UnwrappedLineFormatter.cpp


Index: clang/lib/Format/UnwrappedLineFormatter.cpp
===================================================================
--- clang/lib/Format/UnwrappedLineFormatter.cpp
+++ clang/lib/Format/UnwrappedLineFormatter.cpp
@@ -511,9 +511,9 @@
         ShouldMerge = !Style.BraceWrapping.AfterClass ||
                       (NextLine.First->is(tok::r_brace) &&
                        !Style.BraceWrapping.SplitEmptyRecord);
-      } if(TheLine->InPPDirective ||
-               !TheLine->First->isOneOf(tok::kw_class, tok::kw_enum,
-                                        tok::kw_struct)) {
+      } else if (TheLine->InPPDirective ||
+                 !TheLine->First->isOneOf(tok::kw_class, tok::kw_enum,
+                                          tok::kw_struct)) {
         // Try to merge a block with left brace unwrapped that wasn't yet
         // covered.
         ShouldMerge = !Style.BraceWrapping.AfterFunction ||


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D146310.506133.patch
Type: text/x-patch
Size: 920 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230317/0cd6ff13/attachment.bin>


More information about the cfe-commits mailing list