diff --git a/lib/checkuninitvar.cpp b/lib/checkuninitvar.cpp index 46a4255c9..d382d7f83 100644 --- a/lib/checkuninitvar.cpp +++ b/lib/checkuninitvar.cpp @@ -1131,6 +1131,8 @@ bool CheckUninitVar::checkScopeForVariable(const Token *tok, const unsigned int if (Token::Match(tok, "return|break|continue|throw")) ret = true; + else if (ret && tok->str() == ";") + return false; // variable is seen.. if (tok->varId() == varid) {