Fixed #3183 (False positive: (error) syntax error)

This commit is contained in:
Daniel Marjamäki 2011-10-09 18:42:36 +02:00
parent 175503ef94
commit 96beb94b21
2 changed files with 18 additions and 0 deletions

View File

@ -2389,6 +2389,14 @@ bool Tokenizer::tokenize(std::istream &code,
break;
}
// skip executing scopes (ticket #3183)..
if (Token::simpleMatch(tok, "( {"))
{
tok = tok->next()->link();
if (!tok)
break;
}
// skip executing scopes (ticket #1985)..
if (Token::simpleMatch(tok, "try {"))
{

View File

@ -4582,6 +4582,16 @@ private:
ASSERT_EQUALS("", errout.str());
}
// ok code (ticket #3183)
{
errout.str();
std::istringstream istr("MACRO(({ i < x }))");
Settings settings;
Tokenizer tokenizer(&settings, this);
tokenizer.tokenize(istr, "test.cpp");
ASSERT_EQUALS("", errout.str());
}
// bad code.. missing ">"
{
errout.str("");