Fixed #1984 (false positive: syntax error in for loop (< -operator))

This commit is contained in:
Daniel Marjamäki 2010-08-26 23:24:01 +02:00
parent 57523574ef
commit 8eee4cf2e8
2 changed files with 16 additions and 0 deletions

View File

@ -1792,6 +1792,12 @@ bool Tokenizer::tokenize(std::istream &code, const char FileName[], const std::s
tok = tok->link();
}
// skip executing scopes (ticket #1984)..
if (Token::simpleMatch(tok, "; {"))
{
tok = tok->next()->link();
}
// skip executing scopes (ticket #1985)..
if (Token::simpleMatch(tok, "try {"))
{

View File

@ -3691,6 +3691,16 @@ private:
ASSERT_EQUALS("", errout.str());
}
// ok code (ticket #1984)..
{
errout.str("");
std::istringstream istr("void f(a) int a;\n"
"{ ;x<y; }");
Tokenizer tokenizer(0, this);
tokenizer.tokenize(istr, "test.cpp");
ASSERT_EQUALS("", errout.str());
}
// ok code (ticket #1985)..
{
errout.str("");