Minor modification of previous changeset (compare token with literal using str())

This commit is contained in:
Alexander Mai 2016-01-01 23:37:38 +01:00
parent 37c3d5da7b
commit ee5a5e8bb5
1 changed files with 1 additions and 1 deletions

View File

@ -4260,7 +4260,7 @@ void Tokenizer::simplifyFlowControl()
(Token::Match(tok->previous(), "[;{}] %name% (") && (Token::Match(tok->previous(), "[;{}] %name% (") &&
_settings->library.isnoreturn(tok)) || _settings->library.isnoreturn(tok)) ||
(isCPP() && tok->str() == "throw")) { (isCPP() && tok->str() == "throw")) {
if (tok->next() == "}") if (tok->next()->str() == "}")
syntaxError(tok->next()); // invalid code like in #6731 syntaxError(tok->next()); // invalid code like in #6731
//TODO: ensure that we exclude user-defined 'exit|abort|throw', except for 'noreturn' //TODO: ensure that we exclude user-defined 'exit|abort|throw', except for 'noreturn'
//catch the first ';' //catch the first ';'