[clang] [clang-format] Allow array alignment on non-rectangular arrays (PR #143781)

Björn Schäpers via cfe-commits cfe-commits at lists.llvm.org
Sun Aug 17 09:01:55 PDT 2025


================
@@ -4227,13 +4227,17 @@ void TokenAnnotator::calculateArrayInitializerColumnList(
   if (Line.First == Line.Last)
     return;
   auto *CurrentToken = Line.First;
-  CurrentToken->ArrayInitializerLineStart = true;
   unsigned Depth = 0;
   while (CurrentToken && CurrentToken != Line.Last) {
     if (CurrentToken->is(tok::l_brace)) {
       CurrentToken->IsArrayInitializer = true;
       if (CurrentToken->Next)
         CurrentToken->Next->MustBreakBefore = true;
+
+      // Ensure the end brace of the outer array is on its own line
----------------
HazardyKnusperkeks wrote:

```suggestion
      // Ensure the end brace of the outer array is on its own line.
```

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


More information about the cfe-commits mailing list