Fixed #988 (Tokenizer::simplifyDoWhileAddBraces(): don't add braces after "do" when it not a loop)

FIXME: test cases needed.

http://sourceforge.net/apps/trac/cppcheck/ticket/988
This commit is contained in:
Slava Semushin 2009-11-21 20:44:15 +06:00
parent d7c708cbf4
commit 38a6c41730
1 changed files with 6 additions and 0 deletions

View File

@ -2375,6 +2375,12 @@ void Tokenizer::simplifyDoWhileAddBraces()
continue;
}
if (tok->next()->str() == ")")
{
// fix for #988
continue;
}
Token *tok1 = tok; // token with "do"
Token *tok2 = NULL; // token with "while"
Token *tok3 = tok;