mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-22 06:02:11 +02:00
Bug 487990 - Fix format of variadic functions
Change-Id: I802d032f733247178db46c8fe43fdb9350555509
This commit is contained in:
parent
92df241b38
commit
ff0912e632
2 changed files with 14 additions and 1 deletions
|
@ -2582,7 +2582,9 @@ public class CodeFormatterVisitor extends ASTVisitor implements ICPPASTVisitor,
|
||||||
}
|
}
|
||||||
if (addEllipsis) {
|
if (addEllipsis) {
|
||||||
if (i > 0) {
|
if (i > 0) {
|
||||||
|
if (peekNextToken() == options.fSeparatorToken) {
|
||||||
scribe.printNextToken(options.fSeparatorToken, options.fSpaceBeforeSeparator);
|
scribe.printNextToken(options.fSeparatorToken, options.fSpaceBeforeSeparator);
|
||||||
|
}
|
||||||
scribe.printTrailingComment();
|
scribe.printTrailingComment();
|
||||||
}
|
}
|
||||||
scribe.alignFragment(alignment, i);
|
scribe.alignFragment(alignment, i);
|
||||||
|
|
|
@ -4777,4 +4777,15 @@ public class CodeFormatterTest extends BaseUITestCase {
|
||||||
public void testNoexcept_Bug562723() throws Exception {
|
public void testNoexcept_Bug562723() throws Exception {
|
||||||
assertFormatterResult();
|
assertFormatterResult();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//void foo(int...) {}
|
||||||
|
//int main() {}
|
||||||
|
|
||||||
|
//void foo(int ...) {
|
||||||
|
//}
|
||||||
|
//int main() {
|
||||||
|
//}
|
||||||
|
public void testVariadicFunction_Bug487990() throws Exception {
|
||||||
|
assertFormatterResult();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue