Tokenizer::createLinks2: set no template-links in 'if (a < b || c > d)'
This commit is contained in:
parent
ebc0b6cd44
commit
a52c122229
|
@ -2799,7 +2799,7 @@ void Tokenizer::createLinks2()
|
||||||
token->link(0);
|
token->link(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (token->str() == ";")
|
else if (Token::Match(token, "%oror%|&&|;"))
|
||||||
while (!type.empty() && type.top()->str() == "<")
|
while (!type.empty() && type.top()->str() == "<")
|
||||||
type.pop();
|
type.pop();
|
||||||
else if (token->str() == "<" && token->previous() && token->previous()->isName() && !token->previous()->varId())
|
else if (token->str() == "<" && token->previous() && token->previous()->isName() && !token->previous()->varId())
|
||||||
|
|
|
@ -7093,6 +7093,19 @@ private:
|
||||||
|
|
||||||
ASSERT_EQUALS("", errout.str());
|
ASSERT_EQUALS("", errout.str());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
// if (a < b || c > d) { }
|
||||||
|
const char code[] = "if (a < b || c > d);";
|
||||||
|
errout.str("");
|
||||||
|
Settings settings;
|
||||||
|
Tokenizer tokenizer(&settings, this);
|
||||||
|
std::istringstream istr(code);
|
||||||
|
tokenizer.tokenize(istr, "test.cpp");
|
||||||
|
const Token *tok = tokenizer.tokens();
|
||||||
|
|
||||||
|
ASSERT_EQUALS(true, tok->linkAt(3) == nullptr);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void simplifyString() {
|
void simplifyString() {
|
||||||
|
|
Loading…
Reference in New Issue