diff --git a/lib/symboldatabase.cpp b/lib/symboldatabase.cpp index 4eb1cecf43c..9240f2a09a6 100644 --- a/lib/symboldatabase.cpp +++ b/lib/symboldatabase.cpp @@ -735,6 +735,7 @@ void SymbolDatabase::createSymbolDatabaseFindAllScopes() else if (scope->type == Scope::eCatch) scope->checkVariable(tok->tokAt(2), AccessControl::Throw, mSettings); // check for variable declaration and add it to new scope if found tok = tok->next(); + inIfCondition = true; } else if (Token::Match(tok, "%var% {")) { endInitList.emplace(tok->linkAt(1), scope); tok = tok->next();