summaryrefslogtreecommitdiff
path: root/src/shared/cplusplus/Semantic.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/shared/cplusplus/Semantic.cpp')
-rw-r--r--src/shared/cplusplus/Semantic.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/shared/cplusplus/Semantic.cpp b/src/shared/cplusplus/Semantic.cpp
index 019852cc78..91cb68513f 100644
--- a/src/shared/cplusplus/Semantic.cpp
+++ b/src/shared/cplusplus/Semantic.cpp
@@ -199,7 +199,13 @@ void Semantic::finishFunctionDefinition(FunctionDefinitionAST *ast)
Function *fun = ast->symbol;
d->checkDeclaration->check(ast->ctor_initializer, fun->scope());
- check(ast->function_body, fun->members());
+
+ if (ast->function_body) {
+ check(ast->function_body, fun->members());
+
+ if (CompoundStatementAST *c = ast->function_body->asCompoundStatement())
+ fun->setBlock(c->symbol);
+ }
switchMethodKey(previousMethodKey);
switchVisibility(previousVisibility);