diff options
author | Roberto Raggi <roberto.raggi@nokia.com> | 2010-08-13 11:32:07 +0200 |
---|---|---|
committer | Roberto Raggi <roberto.raggi@nokia.com> | 2010-08-13 11:32:07 +0200 |
commit | c4953e742b560ee891709806d5e14575684ff7ac (patch) | |
tree | 3ea4c028c47dd4974bb41c56cb76b455d3b40843 /src/shared/cplusplus | |
parent | 64e4a8f7ae3e0519a53f11af8d28071ba2ac7313 (diff) | |
download | qt-creator-c4953e742b560ee891709806d5e14575684ff7ac.tar.gz |
Update the function name.
Diffstat (limited to 'src/shared/cplusplus')
-rw-r--r-- | src/shared/cplusplus/Bind.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/shared/cplusplus/Bind.cpp b/src/shared/cplusplus/Bind.cpp index ffcd4aa217..8f98fe8784 100644 --- a/src/shared/cplusplus/Bind.cpp +++ b/src/shared/cplusplus/Bind.cpp @@ -1544,6 +1544,12 @@ bool Bind::visit(SimpleDeclarationAST *ast) Declaration *decl = control()->newDeclaration(sourceLocation, declName); decl->setType(declTy); + + if (Function *fun = decl->type()->asFunctionType()) { + if (declaratorId && declaratorId->name) + fun->setName(declaratorId->name->name); // update the function name + } + if (_scope->isClass()) { decl->setVisibility(_visibility); @@ -1697,6 +1703,10 @@ bool Bind::visit(FunctionDefinitionAST *ast) fun->setVisibility(_visibility); fun->setMethodKey(_methodKey); } + + if (declaratorId && declaratorId->name) + fun->setName(declaratorId->name->name); + _scope->addMember(fun); } else translationUnit()->warning(ast->firstToken(), "expected a function declarator"); |