<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 - AlignAfterOpenBracket, AllowAllParametersOfDeclarationOnNextLine does not work"
href="https://bugs.llvm.org/show_bug.cgi?id=34043">34043</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>AlignAfterOpenBracket, AllowAllParametersOfDeclarationOnNextLine does not work
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>5.0
</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>enhancement
</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>acieszkiel@gmail.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>Created <span class=""><a href="attachment.cgi?id=18899" name="attach_18899" title="Input file">attachment 18899</a> <a href="attachment.cgi?id=18899&action=edit" title="Input file">[details]</a></span>
Input file
.clang-format:
Language: Cpp
AlignAfterOpenBracket: Align
AllowAllParametersOfDeclarationOnNextLine: true
ColumnLimit: 100
TabWidth: 4
UseTab: Never
Input file:
class MyClass
{
public:
int method(int parameter1,
int parameter2,
int parameter3);
};
int MyClass::method(int parameter1,
int parameter2,
int parameter3)
{
return parameter1 + parameter2 + parameter3;
}
int function(int parameter1,
int parameter2,
int parameter3)
{
return parameter1 + parameter2 + parameter3;
}
int main()
{
MyClass m;
int res1 = m.method(343,
444,
999);
int res2 = function(1999,
2343,
6666);
return 0;
}
The output:
class MyClass {
public:
int method(int parameter1, int parameter2, int parameter3);
};
int MyClass::method(int parameter1, int parameter2, int parameter3) {
return parameter1 + parameter2 + parameter3;
}
int function(int parameter1, int parameter2, int parameter3) {
return parameter1 + parameter2 + parameter3;
}
int main() {
MyClass m;
int res1 = m.method(343, 444, 999);
int res2 = function(1999, 2343, 6666);
return 0;
}
Parameters are not aligned and are not allowed to be all in the next lines as
it is in the examples of these options in the specification:
AlignAfterOpenBracket (BracketAlignmentStyle):
BAS_Align (in configuration: Align) Align parameters on the open bracket, e.g.:
someLongFunction(argument1,
argument2);
AllowAllParametersOfDeclarationOnNextLine (bool)
Allow putting all parameters of a function declaration onto the next line even
if BinPackParameters is false.
true: false:
myFunction(foo, vs. myFunction(foo, bar, plop);
bar,
plop);
They work as expected only if a line exceeds 'ColumnLimit'.</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>