[clang] [clang-format] Fix a bug in wrapping { after else (PR #161048)

Björn Schäpers via cfe-commits cfe-commits at lists.llvm.org
Sun Sep 28 03:41:55 PDT 2025


================
@@ -4089,6 +4088,11 @@ void TokenAnnotator::calculateFormattingInformation(AnnotatedLine &Line) const {
     }
   }
 
+  if (First->is(TT_ElseLBrace)) {
+    First->CanBreakBefore = true;
+    First->MustBreakBefore = true;
----------------
HazardyKnusperkeks wrote:

Why `must`?

https://github.com/llvm/llvm-project/pull/161048


More information about the cfe-commits mailing list