Skip to content

Commit

Permalink
Bug 487990 - Fix format of variadic functions
Browse files Browse the repository at this point in the history
Change-Id: I802d032f733247178db46c8fe43fdb9350555509
  • Loading branch information
Marco Stornelli committed Jun 1, 2020
1 parent 92df241 commit ff0912e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2582,7 +2582,9 @@ private void formatList(List<?> elements, ListOptions options, boolean encloseIn
}
if (addEllipsis) {
if (i > 0) {
scribe.printNextToken(options.fSeparatorToken, options.fSpaceBeforeSeparator);
if (peekNextToken() == options.fSeparatorToken) {
scribe.printNextToken(options.fSeparatorToken, options.fSpaceBeforeSeparator);
}
scribe.printTrailingComment();
}
scribe.alignFragment(alignment, i);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4777,4 +4777,15 @@ public void testLambdaExpressionOnlyDefCapture_Bug561559() throws Exception {
public void testNoexcept_Bug562723() throws Exception {
assertFormatterResult();
}

//void foo(int...) {}
//int main() {}

//void foo(int ...) {
//}
//int main() {
//}
public void testVariadicFunction_Bug487990() throws Exception {
assertFormatterResult();
}
}

0 comments on commit ff0912e

Please sign in to comment.