diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/CParameter.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/CParameter.java index 1a3adbddf8b..a50eb79f515 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/CParameter.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/CParameter.java @@ -118,11 +118,14 @@ public class CParameter implements IParameter { return ((IASTCompoundStatement)((IASTFunctionDefinition)parent).getBody()).getScope(); } - IASTFunctionDeclarator fdtor = (IASTFunctionDeclarator) parent.getParent().getParent(); - parent = fdtor.getParent(); - if( parent instanceof IASTFunctionDefinition ) { - return ((IASTCompoundStatement)((IASTFunctionDefinition)parent).getBody()).getScope(); - } + IASTNode fdtorNode = parent.getParent().getParent(); + if (fdtorNode instanceof IASTFunctionDeclarator) { + IASTFunctionDeclarator fdtor = (IASTFunctionDeclarator)fdtorNode; + parent = fdtor.getParent(); + if( parent instanceof IASTFunctionDefinition ) { + return ((IASTCompoundStatement)((IASTFunctionDefinition)parent).getBody()).getScope(); + } + } } //TODO: if not definition, find definition return null; diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPArrayType.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPArrayType.java index 2358b306348..034f1ebd314 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPArrayType.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPArrayType.java @@ -53,7 +53,9 @@ public class CPPArrayType implements IArrayType, ITypeContainer { if( obj instanceof IArrayType ){ try { - return ((IArrayType) obj).getType().isSameType( type ); + IType objType = ((IArrayType)obj).getType(); + if (objType != null) + return objType.isSameType( type ); } catch ( DOMException e ) { return false; } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPFunctionType.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPFunctionType.java index 04232cf2c4e..55676d67231 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPFunctionType.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPFunctionType.java @@ -76,7 +76,7 @@ public class CPPFunctionType implements ICPPFunctionType { return false; } else { for( int i = 0; i < parameters.length; i++ ){ - if( ! parameters[i].isSameType( fps[i] ) ) + if (parameters[i] == null || ! parameters[i].isSameType( fps[i] ) ) return false; } } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPVisitor.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPVisitor.java index 0608804cd4f..57b7832753d 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPVisitor.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPVisitor.java @@ -615,6 +615,8 @@ public class CPPVisitor { } catch ( DOMException e ) { return false; } + if (clsTypeSpec == null) + return false; IASTName clsName = clsTypeSpec.getName(); if( clsName instanceof ICPPASTQualifiedName ){ IASTName [] names = ((ICPPASTQualifiedName)clsName).getNames();