diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPFunctionScope.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPFunctionScope.java index 9c10e74482a..81378b95d0e 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPFunctionScope.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPFunctionScope.java @@ -86,9 +86,12 @@ public class CPPFunctionScope extends CPPScope implements ICPPFunctionScope { public IScope getParent() { // We can't just resolve the function and get its parent scope, since there are cases where that // could loop because resolving functions requires resolving their parameter types. - IASTFunctionDeclarator fdtor = (IASTFunctionDeclarator) getPhysicalNode(); - IASTName name = fdtor.getName().getLastName(); - return CPPVisitor.getContainingNonTemplateScope(name); + IASTFunctionDeclarator funcDeclarator = (IASTFunctionDeclarator) getPhysicalNode(); + IASTName name = funcDeclarator.getName(); + if (name != null) + return CPPVisitor.getContainingNonTemplateScope(name.getLastName()); + + return super.getParent(); } @Override