Commit 98a62c19 authored by Roberto Raggi's avatar Roberto Raggi
Browse files

Push the function scope as soon as we're done processing the core-declarator.

parent 0f301f86
......@@ -345,7 +345,7 @@ bool FindUsages::visit(DeclaratorAST *ast)
return false;
}
void FindUsages::declarator(DeclaratorAST *ast)
void FindUsages::declarator(DeclaratorAST *ast, ScopedSymbol *symbol)
{
if (! ast)
return;
......@@ -356,6 +356,9 @@ void FindUsages::declarator(DeclaratorAST *ast)
for (PtrOperatorListAST *it = ast->ptr_operator_list; it; it = it->next) {
this->ptrOperator(it->value);
}
Scope *previousScope = switchScope(symbol);
this->coreDeclarator(ast->core_declarator);
for (PostfixDeclaratorListAST *it = ast->postfix_declarator_list; it; it = it->next) {
this->postfixDeclarator(it->value);
......@@ -365,6 +368,7 @@ void FindUsages::declarator(DeclaratorAST *ast)
}
// unsigned equals_token = ast->equals_token;
this->expression(ast->initializer);
(void) switchScope(previousScope);
}
bool FindUsages::visit(QtPropertyDeclarationItemAST *ast)
......@@ -1544,8 +1548,8 @@ bool FindUsages::visit(FunctionDefinitionAST *ast)
for (SpecifierListAST *it = ast->decl_specifier_list; it; it = it->next) {
this->specifier(it->value);
}
Scope *previousScope = switchScope(ast->symbol); // ### not exactly.
this->declarator(ast->declarator);
this->declarator(ast->declarator, ast->symbol);
Scope *previousScope = switchScope(ast->symbol);
this->ctorInitializer(ast->ctor_initializer);
this->statement(ast->function_body);
// Function *symbol = ast->symbol;
......
......@@ -97,7 +97,7 @@ protected:
void objCSelectorArgument(ObjCSelectorArgumentAST *ast);
void attribute(AttributeAST *ast);
void declarator(DeclaratorAST *ast);
void declarator(DeclaratorAST *ast, ScopedSymbol *symbol = 0);
void qtPropertyDeclarationItem(QtPropertyDeclarationItemAST *ast);
void qtInterfaceName(QtInterfaceNameAST *ast);
void baseSpecifier(BaseSpecifierAST *ast);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment