1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-08 10:16:03 +02:00

Bug 145245 - Added check in CPPASTTemplateId to detect that we're recursing and return null if we are. I also had to change CPPClassScope a little which wasn't expecting the null.

This commit is contained in:
Doug Schaefer 2006-06-09 17:50:30 +00:00
parent 7279f74fd0
commit 52d99fabef
2 changed files with 9 additions and 5 deletions

View file

@ -65,13 +65,18 @@ public class CPPASTTemplateId extends CPPASTNode implements ICPPASTTemplateId, I
private IASTNode [] templateArguments = null; private IASTNode [] templateArguments = null;
private IBinding binding = null; private IBinding binding = null;
private boolean resolving = false;
/* (non-Javadoc) /* (non-Javadoc)
* @see org.eclipse.cdt.core.dom.ast.IASTName#resolveBinding() * @see org.eclipse.cdt.core.dom.ast.IASTName#resolveBinding()
*/ */
public IBinding resolveBinding() { public IBinding resolveBinding() {
if( binding == null ) if (binding == null && !resolving) {
// protect for infinite recursion
resolving = true;
binding = CPPTemplates.createBinding( this ); binding = CPPTemplates.createBinding( this );
resolving = false;
}
return binding; return binding;
} }

View file

@ -255,9 +255,8 @@ public class CPPClassScope extends CPPScope implements ICPPClassScope {
Object obj = set.keyAt( i ); Object obj = set.keyAt( i );
if( obj instanceof IASTName ){ if( obj instanceof IASTName ){
IASTName n = (IASTName) obj; IASTName n = (IASTName) obj;
binding = n.getBinding(); binding = forceResolve ? n.resolveBinding() : n.getBinding();
if( binding != null || forceResolve ){ if( binding != null ) {
binding = n.resolveBinding();
set.remove( n ); set.remove( n );
set.put( binding ); set.put( binding );
i--; i--;