From f2a86c5b5ef2ae1b50fa7d4ac009771e625238f7 Mon Sep 17 00:00:00 2001 From: Thomas Corbat Date: Wed, 22 Jul 2015 08:50:11 +0200 Subject: [PATCH] Replaced impossible instanceof check in ASTQueries: It does not make sense for findTypeRelevantDeclarator to check whether the innermost declarator (result) is of type IASTArrayModifier: - There is no common subtype of IASTDeclarator and IASTArrayModifier. - IASTArrayModifier are attached to IASTArrayDeclarators but they are not resolved as nested declarators. - Similar to the existence of pointer operators, the resolution of the innermost type relevant declarator should stop at array declarators. Change-Id: I9c3673f60a48245eb51ccc8cb94757b87abf0265 Signed-off-by: Thomas Corbat --- .../org/eclipse/cdt/internal/core/dom/parser/ASTQueries.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/ASTQueries.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/ASTQueries.java index 018e8fbddff..6a484bc4921 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/ASTQueries.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/ASTQueries.java @@ -11,7 +11,7 @@ package org.eclipse.cdt.internal.core.dom.parser; import org.eclipse.cdt.core.dom.ast.ASTVisitor; -import org.eclipse.cdt.core.dom.ast.IASTArrayModifier; +import org.eclipse.cdt.core.dom.ast.IASTArrayDeclarator; import org.eclipse.cdt.core.dom.ast.IASTDeclaration; import org.eclipse.cdt.core.dom.ast.IASTDeclarator; import org.eclipse.cdt.core.dom.ast.IASTFieldDeclarator; @@ -117,7 +117,7 @@ public class ASTQueries { while (result.getPointerOperators().length == 0 && !(result instanceof IASTFieldDeclarator) && !(result instanceof IASTFunctionDeclarator) - && !(result instanceof IASTArrayModifier)) { + && !(result instanceof IASTArrayDeclarator)) { final IASTNode parent= result.getParent(); if (parent instanceof IASTDeclarator) { result= (IASTDeclarator) parent;