From c4953e742b560ee891709806d5e14575684ff7ac Mon Sep 17 00:00:00 2001
From: Roberto Raggi <roberto.raggi@nokia.com>
Date: Fri, 13 Aug 2010 11:32:07 +0200
Subject: [PATCH] Update the function name.

---
 src/shared/cplusplus/Bind.cpp | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/src/shared/cplusplus/Bind.cpp b/src/shared/cplusplus/Bind.cpp
index ffcd4aa217b..8f98fe87842 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");
-- 
GitLab