summaryrefslogtreecommitdiff
path: root/src/shared/cplusplus/Bind.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/shared/cplusplus/Bind.cpp')
-rw-r--r--src/shared/cplusplus/Bind.cpp10
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");