Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkus Schorn2007-12-10 05:14:39 -0500
committerMarkus Schorn2007-12-10 05:14:39 -0500
commit2fd98afe979417047fcad95eb9c8e6e3bad50387 (patch)
tree717b5dda5ec0c96c0dea5644f4aefd4cdcf12a4e
parenta22d729e408e6dc8167e4c1058239ea3a73af8cf (diff)
downloadorg.eclipse.cdt-2fd98afe979417047fcad95eb9c8e6e3bad50387.tar.gz
org.eclipse.cdt-2fd98afe979417047fcad95eb9c8e6e3bad50387.tar.xz
org.eclipse.cdt-2fd98afe979417047fcad95eb9c8e6e3bad50387.zip
Fixes an exception in name resolution (second try), bug 211457.
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPVisitor.java7
1 files changed, 4 insertions, 3 deletions
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 2336ea92cf..8d3dd97f30 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
@@ -704,9 +704,10 @@ public class CPPVisitor {
}
- public static IScope getContainingScope( IASTNode node ){
- if( node == null )
+ public static IScope getContainingScope( final IASTNode inputNode ){
+ if( inputNode == null || inputNode instanceof IASTTranslationUnit)
return null;
+ IASTNode node= inputNode;
while( node != null ){
if( node instanceof IASTName && !( node instanceof ICPPASTQualifiedName ) ){
return getContainingScope( (IASTName) node );
@@ -813,7 +814,7 @@ public class CPPVisitor {
}
node = node.getParent();
}
- return null;
+ return new CPPScope.CPPScopeProblem( inputNode, IProblemBinding.SEMANTIC_BAD_SCOPE, inputNode.getRawSignature().toCharArray() );
}
public static IScope getContainingScope( IASTName name ){

Back to the top