diff --git a/lib/checkother.cpp b/lib/checkother.cpp index 15a8d89ec6a..2999e546043 100644 --- a/lib/checkother.cpp +++ b/lib/checkother.cpp @@ -991,7 +991,7 @@ void CheckOther::checkVariableScope() } } -bool CheckOther::checkInnerScope(const Token *tok, const Variable* var, bool& used) +bool CheckOther::checkInnerScope(const Token *tok, const Variable* var, bool& used) const { const Scope* scope = tok->next()->scope(); bool loopVariable = scope->isLoopScope(); diff --git a/lib/checkother.h b/lib/checkother.h index efae5459d2d..747f1e63857 100644 --- a/lib/checkother.h +++ b/lib/checkother.h @@ -123,7 +123,7 @@ class CPPCHECKLIB CheckOther : public Check { /** @brief %Check scope of variables */ void checkVariableScope(); - bool checkInnerScope(const Token *tok, const Variable* var, bool& used); + bool checkInnerScope(const Token *tok, const Variable* var, bool& used) const; /** @brief %Check for comma separated statements in return */ void checkCommaSeparatedReturn();