diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPNamespace.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPNamespace.java index 16b5121d311..6f99d1cc86f 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPNamespace.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPNamespace.java @@ -38,6 +38,7 @@ import org.eclipse.cdt.core.parser.util.ArrayUtil; import org.eclipse.cdt.core.parser.util.CharArrayUtils; import org.eclipse.cdt.core.parser.util.ObjectSet; import org.eclipse.cdt.internal.core.dom.parser.ASTNode; +import org.eclipse.cdt.internal.core.dom.parser.ProblemBinding; import org.eclipse.core.runtime.PlatformObject; /** @@ -54,6 +55,26 @@ public class CPPNamespace extends PlatformObject implements ICPPNamespace, ICPPI public IBinding[] getMemberBindings() throws DOMException { return ((ICPPNamespace)getBinding()).getMemberBindings(); } + } + public static class CPPNamespaceProblem extends ProblemBinding implements ICPPNamespace{ + public CPPNamespaceProblem( IASTNode node, int id, char[] arg ) { + super( node, id, arg ); + } + public ICPPNamespaceScope getNamespaceScope() throws DOMException { + throw new DOMException(this); + } + public IBinding[] getMemberBindings() throws DOMException { + throw new DOMException(this); + } + public String[] getQualifiedName() throws DOMException { + throw new DOMException(this); + } + public char[][] getQualifiedNameCharArray() throws DOMException { + throw new DOMException(this); + } + public boolean isGloballyQualified() throws DOMException { + throw new DOMException(this); + } } private static final char[] EMPTY_CHAR_ARRAY = { }; 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 0b9651610f3..87c3035ad23 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 @@ -436,7 +436,11 @@ public class CPPVisitor { binding = scope.getBinding( alias.getAlias(), false ); if( binding == null ){ IBinding namespace = alias.getMappingName().resolveBinding(); - if( namespace instanceof ICPPNamespace ){ + if( namespace instanceof IProblemBinding ){ + IProblemBinding problem = (IProblemBinding) namespace; + namespace = new CPPNamespace.CPPNamespaceProblem( problem.getASTNode(), problem.getID(), alias.getMappingName().toCharArray()); + } + if( namespace instanceof ICPPNamespace ) { binding = new CPPNamespaceAlias( alias.getAlias(), (ICPPNamespace) namespace ); scope.addName( alias.getAlias() ); } else {