diff --git a/lib/tokenize.cpp b/lib/tokenize.cpp index 9fb3409fd..826966598 100644 --- a/lib/tokenize.cpp +++ b/lib/tokenize.cpp @@ -3649,7 +3649,8 @@ void Tokenizer::simplifyFlowControl() eraseDeadCode(tok, 0); } else if (Token::Match(tok,"return|goto") || - (Token::Match(tok,"exit|throw|abort") && !Token::Match(tok->previous(),"%type%"))) { + (Token::Match(tok,"exit|abort") && !Token::Match(tok->previous(),"%type%")) || + (tok->str() == "throw" && !isC())) { //catch the first ';' for (Token *tok2 = tok->next(); tok2; tok2 = tok2->next()) { if (tok2->str() == "(" || tok2->str() == "[") {