[PATCH] Leave constructor initializer lists on one line in styles with no column limit.

Daniel Jasper djasper at google.com
Tue Dec 3 23:13:39 PST 2013


  I think we should try to move to a better documentation in the long run. Do you have any ideas where to document this behavior? Maybe in the comment to ColumnLimit? Can be done in a follow-up, though, so this looks good.


================
Comment at: lib/Format/Format.cpp:663
@@ +662,3 @@
+      if (MergedLines > 0 && Style.ColumnLimit == 0) {
+        // Disallow line merging when there's a break in the input.
+        for (unsigned i = 0; i < MergedLines; ++i) {
----------------
nit: I think the implemented behavior makes sense but the comment is not entirely correct. Maybe change to:

  // Disallow line merging if there is a break at the start of one of the input lines.

================
Comment at: lib/Format/Format.cpp:713
@@ -704,3 +712,3 @@
           if (!DryRun)
-            Formatter.format(Indent, &TheLine);
+            Formatter.format(Indent, &TheLine, MergedLines > 0);
         } else {
----------------
nit: Use:
  /*LineIsMerged=*/MergedLines > 0


http://llvm-reviews.chandlerc.com/D2321

BRANCH
  svn

ARCANIST PROJECT
  clang



More information about the cfe-commits mailing list