1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

Fixes an exception in name resolution (second try), bug 211457.

This commit is contained in:
Markus Schorn 2007-12-10 10:03:50 +00:00
parent f1ca140b10
commit 45b020487a

View file

@ -705,9 +705,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 );
@ -814,7 +815,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 ){