Commit d586e139 authored by Roberto Raggi's avatar Roberto Raggi

Search for the local usages after processing the function body.

parent 5c741218
......@@ -528,6 +528,12 @@ void CheckSymbols::endVisit(TemplateDeclarationAST *)
bool CheckSymbols::visit(FunctionDefinitionAST *ast)
{
_functionDefinitionStack.append(ast);
accept(ast->decl_specifier_list);
accept(ast->declarator);
accept(ast->ctor_initializer);
accept(ast->function_body);
const LocalSymbols locals(_doc, ast);
QList<SemanticInfo::Use> uses;
foreach (uses, locals.uses) {
......@@ -535,11 +541,6 @@ bool CheckSymbols::visit(FunctionDefinitionAST *ast)
addTypeUsage(u);
}
accept(ast->decl_specifier_list);
accept(ast->declarator);
accept(ast->ctor_initializer);
accept(ast->function_body);
_functionDefinitionStack.removeLast();
return false;
}
......
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