mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-23 17:05:26 +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();
|
||||
for ( int i = 0; i < params.length; i++ ) {
|
||||
if( !params[i].accept( action ) ) return false;
|
||||
}
|
||||
//TODO bindings for template parameters aren't done yet, trying to resolve one would result in trouble,
|
||||
//so don't visit them for now.
|
||||
// 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;
|
||||
return true;
|
||||
|
|
|
@ -520,12 +520,15 @@ public class CPPVisitor {
|
|||
} else if( node instanceof IASTTypeId ){
|
||||
node = node.getParent();
|
||||
} else if( node instanceof IASTParameterDeclaration ){
|
||||
ICPPASTFunctionDeclarator dtor = (ICPPASTFunctionDeclarator) node.getParent();
|
||||
ASTNodeProperty prop = dtor.getPropertyInParent();
|
||||
if( prop == IASTSimpleDeclaration.DECLARATOR )
|
||||
return dtor.getFunctionScope();
|
||||
else if( prop == IASTFunctionDefinition.DECLARATOR )
|
||||
return ((IASTCompoundStatement)((IASTFunctionDefinition)dtor.getParent()).getBody()).getScope();
|
||||
IASTNode parent = node.getParent();
|
||||
if( parent instanceof ICPPASTFunctionDeclarator ){
|
||||
ICPPASTFunctionDeclarator dtor = (ICPPASTFunctionDeclarator) parent;
|
||||
ASTNodeProperty prop = dtor.getPropertyInParent();
|
||||
if( prop == IASTSimpleDeclaration.DECLARATOR )
|
||||
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 ){
|
||||
IASTNode parent = node.getParent();
|
||||
while( !(parent instanceof IASTDeclarator) )
|
||||
|
|
Loading…
Add table
Reference in a new issue