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

Bug 516685 - ClassCastException in CPPTemplates.createInstance()

Change-Id: I9b4ca25afa60a6ed3a79411cc5daa27add3e9cba
This commit is contained in:
Nathan Ridge 2017-05-16 02:15:42 -04:00
parent 0880413e98
commit b0cfef83db

View file

@ -954,7 +954,7 @@ public class CPPTemplates {
IValue value;
ICPPASTDeclarator decl = ASTQueries.findAncestorWithType(point, ICPPASTDeclarator.class);
if (((IASTName) point).getRoleOfName(false) == IASTNameOwner.r_definition
if (point instanceof IASTName && ((IASTName) point).getRoleOfName(false) == IASTNameOwner.r_definition
&& decl != null && decl.getInitializer() != null) {
// Explicit specialization.
value = SemanticUtil.getValueOfInitializer(decl.getInitializer(), type);