<html>
<head>
<base href="https://bugs.llvm.org/">
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW - Inconsistency of BreakConstructorInitializers with respect to ColumnLimit"
href="https://bugs.llvm.org/show_bug.cgi?id=46706">46706</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Inconsistency of BreakConstructorInitializers with respect to ColumnLimit
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>trunk
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>Windows NT
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>Formatter
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>saket.rungta@tallysolutions.com
</td>
</tr>
<tr>
<th>CC</th>
<td>djasper@google.com, klimek@google.com, llvm-bugs@lists.llvm.org
</td>
</tr></table>
<p>
<div>
<pre>Documentation for BreakConstructorInitializers at
<a href="https://clang.llvm.org/docs/ClangFormatStyleOptions.htm">https://clang.llvm.org/docs/ClangFormatStyleOptions.htm</a> DOES NOT imply that the
behaviour is subject to ColumnLimit.
BreakConstructorInitializers was introduced in: <a href="https://reviews.llvm.org/D32479">https://reviews.llvm.org/D32479</a>
A related request and differential is: <a href="https://reviews.llvm.org/D14484">https://reviews.llvm.org/D14484</a>
What we currently have is inconsistent behaviour, which I propose to patch and
also offer to maintain, along the lines of earlier work either as suggested in
(a) <a href="https://reviews.llvm.org/D14484">https://reviews.llvm.org/D14484</a> or (b)
<a href="https://github.com/llvm-mirror/clang/pull/67">https://github.com/llvm-mirror/clang/pull/67</a> or (c) any other way.
Consider the following default LLVM style configuration at 'master' currently:
AllowAllConstructorInitializersOnNextLine: true
BreakConstructorInitializersBeforeComma: false
BreakConstructorInitializers: BeforeColon
ColumnLimit: 80
ConstructorInitializerAllOnOneLineOrOnePerLine: false
And sample test file (same as official documentation referred above):
D:\>clang-format.exe test.cpp
Constructor() : initializer1(), initializer2()
Output with: BreakConstructorInitializers: BeforeColon
Constructor() : initializer1(), initializer2()
That is, no change.
Output with: BreakConstructorInitializers: AfterColon
Constructor() : initializer1(), initializer2()
That is, no change.
Output with: BreakConstructorInitializers: BeforeComma
Constructor()
: initializer1()
, initializer2()
That currently only the BeforeComma option works without consideration to
ColumnLimit.
This bug report is to make the three choices consistent with each other with
consideration to ColumnLimit, preferably with a choice to enforce line break
irrespective of ColumnLimit as others have requested earlier.</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>