CheckCondition: Use isLikelyStreamRead
This commit is contained in:
parent
0263452f5d
commit
3d78320d04
|
@ -648,13 +648,10 @@ void CheckCondition::multiCondition2()
|
||||||
if (Token::Match(parent->astParent(), "%assign%"))
|
if (Token::Match(parent->astParent(), "%assign%"))
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (_tokenizer->isCPP() && Token::Match(tok, "%name% <<|>>") && (!tok->valueType() || !tok->valueType()->isIntegral()))
|
if (_tokenizer->isCPP() && Token::Match(tok, "%name% <<") && (!tok->valueType() || !tok->valueType()->isIntegral()))
|
||||||
|
break;
|
||||||
|
if (isLikelyStreamRead(_tokenizer->isCPP(), tok->next()) || isLikelyStreamRead(_tokenizer->isCPP(), tok->previous()))
|
||||||
break;
|
break;
|
||||||
if (_tokenizer->isCPP() && Token::simpleMatch(tok->previous(), ">>")) {
|
|
||||||
const Token *rhs = tok->previous()->astOperand1();
|
|
||||||
if (!rhs || !rhs->valueType() || !rhs->valueType()->isIntegral())
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
if (Token::Match(tok, "%name% [")) {
|
if (Token::Match(tok, "%name% [")) {
|
||||||
const Token *tok2 = tok->linkAt(1);
|
const Token *tok2 = tok->linkAt(1);
|
||||||
while (Token::simpleMatch(tok2, "] ["))
|
while (Token::simpleMatch(tok2, "] ["))
|
||||||
|
|
Loading…
Reference in New Issue