mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-24 01:15:29 +02:00
Bug 464498 - sizeof...() operator formatting exception
Fix for exception when formatting sizeof... Change-Id: Ibe228ee5566b9155e1e86853506f3ee516d05e7a Signed-off-by: Thomas Corbat <tcorbat@hsr.ch>
This commit is contained in:
parent
473c5c8ff1
commit
b218771722
2 changed files with 18 additions and 2 deletions
|
@ -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) {
|
||||
|
|
|
@ -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<typename ...ARGS>
|
||||
//int count(ARGS ... args) {
|
||||
// return sizeof...(ARGS);
|
||||
//}
|
||||
|
||||
//template<typename ...ARGS>
|
||||
//int count(ARGS ... args) {
|
||||
// return sizeof...(ARGS);
|
||||
//}
|
||||
public void testSizeofParameterPackFormat_464498() throws Exception {
|
||||
assertFormatterResult();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue