mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-05 07:15:39 +02:00
Don't visit template parameters until we are ready for them
This commit is contained in:
parent
274eae0dd9
commit
6c62456688
2 changed files with 15 additions and 10 deletions
|
@ -106,10 +106,12 @@ public class CPPASTTemplateDeclaration extends CPPASTNode implements
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ICPPASTTemplateParameter [] params = getTemplateParameters();
|
//TODO bindings for template parameters aren't done yet, trying to resolve one would result in trouble,
|
||||||
for ( int i = 0; i < params.length; i++ ) {
|
//so don't visit them for now.
|
||||||
if( !params[i].accept( action ) ) return false;
|
// ICPPASTTemplateParameter [] params = getTemplateParameters();
|
||||||
}
|
// for ( int i = 0; i < params.length; i++ ) {
|
||||||
|
// if( !params[i].accept( action ) ) return false;
|
||||||
|
// }
|
||||||
|
|
||||||
if( declaration != null ) if( !declaration.accept( action ) ) return false;
|
if( declaration != null ) if( !declaration.accept( action ) ) return false;
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -520,12 +520,15 @@ public class CPPVisitor {
|
||||||
} else if( node instanceof IASTTypeId ){
|
} else if( node instanceof IASTTypeId ){
|
||||||
node = node.getParent();
|
node = node.getParent();
|
||||||
} else if( node instanceof IASTParameterDeclaration ){
|
} else if( node instanceof IASTParameterDeclaration ){
|
||||||
ICPPASTFunctionDeclarator dtor = (ICPPASTFunctionDeclarator) node.getParent();
|
IASTNode parent = node.getParent();
|
||||||
ASTNodeProperty prop = dtor.getPropertyInParent();
|
if( parent instanceof ICPPASTFunctionDeclarator ){
|
||||||
if( prop == IASTSimpleDeclaration.DECLARATOR )
|
ICPPASTFunctionDeclarator dtor = (ICPPASTFunctionDeclarator) parent;
|
||||||
return dtor.getFunctionScope();
|
ASTNodeProperty prop = dtor.getPropertyInParent();
|
||||||
else if( prop == IASTFunctionDefinition.DECLARATOR )
|
if( prop == IASTSimpleDeclaration.DECLARATOR )
|
||||||
return ((IASTCompoundStatement)((IASTFunctionDefinition)dtor.getParent()).getBody()).getScope();
|
return dtor.getFunctionScope();
|
||||||
|
else if( prop == IASTFunctionDefinition.DECLARATOR )
|
||||||
|
return ((IASTCompoundStatement)((IASTFunctionDefinition)dtor.getParent()).getBody()).getScope();
|
||||||
|
} //else if( node instanceof ICPPASTTemplateDeclaration )
|
||||||
} else if( node instanceof IASTInitializerExpression ){
|
} else if( node instanceof IASTInitializerExpression ){
|
||||||
IASTNode parent = node.getParent();
|
IASTNode parent = node.getParent();
|
||||||
while( !(parent instanceof IASTDeclarator) )
|
while( !(parent instanceof IASTDeclarator) )
|
||||||
|
|
Loading…
Add table
Reference in a new issue