Fixed #1984 (false positive: syntax error in for loop (< -operator))
This commit is contained in:
parent
57523574ef
commit
8eee4cf2e8
|
@ -1792,6 +1792,12 @@ bool Tokenizer::tokenize(std::istream &code, const char FileName[], const std::s
|
||||||
tok = tok->link();
|
tok = tok->link();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// skip executing scopes (ticket #1984)..
|
||||||
|
if (Token::simpleMatch(tok, "; {"))
|
||||||
|
{
|
||||||
|
tok = tok->next()->link();
|
||||||
|
}
|
||||||
|
|
||||||
// skip executing scopes (ticket #1985)..
|
// skip executing scopes (ticket #1985)..
|
||||||
if (Token::simpleMatch(tok, "try {"))
|
if (Token::simpleMatch(tok, "try {"))
|
||||||
{
|
{
|
||||||
|
|
|
@ -3691,6 +3691,16 @@ private:
|
||||||
ASSERT_EQUALS("", errout.str());
|
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)..
|
// ok code (ticket #1985)..
|
||||||
{
|
{
|
||||||
errout.str("");
|
errout.str("");
|
||||||
|
|
Loading…
Reference in New Issue