diff --git a/src/shared/cplusplus/Bind.cpp b/src/shared/cplusplus/Bind.cpp index c04cf0724d6..ffcd4aa217b 100644 --- a/src/shared/cplusplus/Bind.cpp +++ b/src/shared/cplusplus/Bind.cpp @@ -112,6 +112,20 @@ void Bind::operator()(TranslationUnitAST *ast, Namespace *globalNamespace) (void) switchScope(previousScope); } +void Bind::operator()(DeclarationAST *ast, Scope *scope) +{ + Scope *previousScope = switchScope(scope); + declaration(ast); + (void) switchScope(previousScope); +} + +void Bind::operator()(ExpressionAST *ast, Scope *scope) +{ + Scope *previousScope = switchScope(scope); + expression(ast); + (void) switchScope(previousScope); +} + void Bind::statement(StatementAST *ast) { accept(ast); diff --git a/src/shared/cplusplus/Bind.h b/src/shared/cplusplus/Bind.h index 0669d002134..81412bb920b 100644 --- a/src/shared/cplusplus/Bind.h +++ b/src/shared/cplusplus/Bind.h @@ -60,6 +60,8 @@ public: Bind(TranslationUnit *unit); void operator()(TranslationUnitAST *ast, Namespace *globalNamespace); + void operator()(DeclarationAST *ast, Scope *scope); + void operator()(ExpressionAST *ast, Scope *scope); bool skipFunctionBodies() const; void setSkipFunctionBodies(bool skipFunctionBodies);