https://bugs.llvm.org/show_bug.cgi?id=36611

            Bug ID: 36611
           Summary: One item per line in array initializer
           Product: clang
           Version: 5.0
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Formatter
          Assignee: unassignedclangb...@nondot.org
          Reporter: martin.thom...@gmail.com
                CC: djas...@google.com, kli...@google.com,
                    llvm-bugs@lists.llvm.org

clang-format 5 and 6 (haven't tested others) rewrite array initializers with
one item per line when ColumnLimit is 0:

 static const uint8_t ff_dhe_3072_p[] = {
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF,
+    0xFF,
+    0xFF,
+    0xFF,
+    0xFF,
+    0xFF,
+    0xFF,
+    0xFF,
 };

The actual example is much larger.

The documentation for ColumnLimit says:

"A column limit of 0 means that there is no column limit. In this case,
clang-format will respect the input’s line breaking decisions within statements
unless they contradict other rules."

That doesn't appear to hold.

The last known version to respect this is 3.9.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to