1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-23 22:52:11 +02:00

Bug 519790 - ClassCastException in CPPVisitor.createAutoParameterType()

Change-Id: If200ee08b61b94af2d559505498b4dbc585c3d6e
This commit is contained in:
Nathan Ridge 2017-07-17 19:48:20 -04:00
parent 01a45c3d00
commit 862cf70fa3

View file

@ -2178,8 +2178,15 @@ public class CPPVisitor extends ASTQueries {
placeholderKind);
}
if (declarator.getParent() instanceof ICPPASTParameterDeclaration) {
if (declarator.getParent().getParent() instanceof ICPPASTFunctionDeclarator) {
// 'auto' used as the type of a function parameter.
return createAutoParameterType(declSpec, declarator,
(ICPPASTParameterDeclaration) declarator.getParent(), placeholderKind);
} else {
// 'auto' used as the type of a template parameter.
// This is a C++17 feature we don't yet support.
return ProblemType.CANNOT_DEDUCE_AUTO_TYPE;
}
}
ICPPASTInitializerClause autoInitClause= null;
IASTNode parent = declarator.getParent().getParent();