<html>
<head>
<base href="https://llvm.org/bugs/" />
</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 --- - clang-format: add a style option for disabling all function arguments on one line"
href="https://llvm.org/bugs/show_bug.cgi?id=28762">28762</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>clang-format: add a style option for disabling all function arguments on one line
</td>
</tr>
<tr>
<th>Product</th>
<td>new-bugs
</td>
</tr>
<tr>
<th>Version</th>
<td>trunk
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>All
</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>new bugs
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>jacobsa@google.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>The style option `AllowAllParametersOfDeclarationOnNextLine` allows me to
prevent clang-format from pulling all parameters in a function declaration onto
a single line when I have intentionally put them on separate lines. This is
great.
But there doesn't appear to be a corresponding option for function calls.
`clang-format` is happy to pull function arguments onto a single line, even
when I've intentionally put them on separate lines and disabled bin packing.
Small example that reproduces this:
% cat .clang-format
ColumnLimit: 80
BinPackArguments: false
BinPackParameters: false
AllowAllParametersOfDeclarationOnNextLine: false
AlignAfterOpenBracket: AlwaysBreak
% cat foo.cc
extern int arg_0, arg_1, arg_2;
void
DoSomethingWithThreeIntsThatRequiresAVeryLongFunctionNameSeriouslyLong(
int a,
int b,
int c);
void foo() {
// I'm intentionally putting these one per line; I want them to align.
DoSomethingWithThreeIntsThatRequiresAVeryLongFunctionNameSeriouslyLong(
arg_0,
arg_1,
arg_2);
}
% clang-format -style=file foo.cc
extern int arg_0, arg_1, arg_2;
void
DoSomethingWithThreeIntsThatRequiresAVeryLongFunctionNameSeriouslyLong(
int a,
int b,
int c);
void foo() {
// I'm intentionally putting these one per line; I want them to align.
DoSomethingWithThreeIntsThatRequiresAVeryLongFunctionNameSeriouslyLong(
arg_0, arg_1, arg_2);
}</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>