https://bugs.llvm.org/show_bug.cgi?id=34043
Bug ID: 34043
Summary: AlignAfterOpenBracket,
AllowAllParametersOfDeclarationOnNextLine does not
work
Product: clang
Version: 5.0
Hardware: PC
OS: Windows NT
Status: NEW
Severity: enhancement
Priority: P
Component: Formatter
Assignee: unassignedclangb...@nondot.org
Reporter: acieszk...@gmail.com
CC: djas...@google.com, kli...@google.com,
llvm-bugs@lists.llvm.org
Created attachment 18899
--> https://bugs.llvm.org/attachment.cgi?id=18899&action=edit
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'.
--
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