diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/formatter/CodeFormatterVisitor.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/formatter/CodeFormatterVisitor.java index 04e7e7cd289..99d2d0d7349 100644 --- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/formatter/CodeFormatterVisitor.java +++ b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/formatter/CodeFormatterVisitor.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2016 Wind River Systems, Inc. and others. + * Copyright (c) 2006, 2017 Wind River Systems, Inc. and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -2416,6 +2416,9 @@ public class CodeFormatterVisitor extends ASTVisitor implements ICPPASTVisitor, return PROCESS_SKIP; } scribe.printNextToken(peekNextToken()); + if (peekNextToken() == IToken.tELLIPSIS) { + scribe.printNextToken(IToken.tELLIPSIS); + } scribe.printNextToken(Token.tLPAREN); node.getTypeId().accept(this); if (peekNextToken() == Token.tCOMMA) { diff --git a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/CodeFormatterTest.java b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/CodeFormatterTest.java index 12b2f18a031..f9e30efddb1 100644 --- a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/CodeFormatterTest.java +++ b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/CodeFormatterTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2016 Wind River Systems, Inc. and others. + * Copyright (c) 2007, 2017 Wind River Systems, Inc. and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -3196,4 +3196,17 @@ public class CodeFormatterTest extends BaseUITestCase { CCorePlugin.DO_NOT_INSERT); assertFormatterResult(); } + + //template + //int count(ARGS ... args) { + // return sizeof...(ARGS); + //} + + //template + //int count(ARGS ... args) { + // return sizeof...(ARGS); + //} + public void testSizeofParameterPackFormat_464498() throws Exception { + assertFormatterResult(); + } }