mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Bug 520893 Pack expansion in IASTTypeId is lost
Change-Id: I9137d028c56ce62ee02571099a7a5ab1b2b481cd Signed-off-by: Thomas Corbat <tcorbat@hsr.ch>
This commit is contained in:
parent
27b467cb11
commit
c7b6aa3bd5
2 changed files with 28 additions and 0 deletions
|
@ -113,3 +113,13 @@ int i = 2;
|
|||
//%CPP
|
||||
typename T::A* a6;
|
||||
|
||||
//!Variadic Template
|
||||
//%CPP
|
||||
template<typename... T> struct Tpl
|
||||
{
|
||||
};
|
||||
|
||||
template<typename... T>
|
||||
void foo(Tpl<T...>)
|
||||
{
|
||||
}
|
|
@ -32,10 +32,12 @@ import org.eclipse.cdt.core.dom.ast.IASTParameterDeclaration;
|
|||
import org.eclipse.cdt.core.dom.ast.IASTPointerOperator;
|
||||
import org.eclipse.cdt.core.dom.ast.IASTStatement;
|
||||
import org.eclipse.cdt.core.dom.ast.IASTTranslationUnit;
|
||||
import org.eclipse.cdt.core.dom.ast.IASTTypeId;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTCompositeTypeSpecifier.ICPPASTBaseSpecifier;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTDecltypeSpecifier;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTNamespaceDefinition;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTTemplateParameter;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTTypeId;
|
||||
import org.eclipse.cdt.core.dom.ast.gnu.IGNUASTCompoundStatementExpression;
|
||||
import org.eclipse.cdt.core.model.ITranslationUnit;
|
||||
import org.eclipse.cdt.core.parser.Keywords;
|
||||
|
@ -290,6 +292,22 @@ public class ASTWriterVisitor extends ASTVisitor {
|
|||
return ASTVisitor.PROCESS_SKIP;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int visit(IASTTypeId typeId) {
|
||||
IASTDeclSpecifier declSpecifier = typeId.getDeclSpecifier();
|
||||
if (declSpecifier != null) declSpecifier.accept(this);
|
||||
if (typeId instanceof ICPPASTTypeId) {
|
||||
if (((ICPPASTTypeId) typeId).isPackExpansion()) {
|
||||
scribe.print(Keywords.cpELLIPSIS);
|
||||
}
|
||||
}
|
||||
IASTDeclarator declarator = typeId.getAbstractDeclarator();
|
||||
if (declarator != null) {
|
||||
declarator.accept(this);
|
||||
}
|
||||
return ASTVisitor.PROCESS_SKIP;
|
||||
}
|
||||
|
||||
protected IASTName getParameterName(IASTDeclarator declarator) {
|
||||
return declarator.getName();
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue