CheckCondition: Fix FP in daca (iqtree) 'in >> ch'
This commit is contained in:
parent
8f6c98e3d6
commit
bb20c0504e
|
@ -646,8 +646,13 @@ void CheckCondition::multiCondition2()
|
|||
if (Token::Match(parent->astParent(), "%assign%"))
|
||||
break;
|
||||
}
|
||||
if (Token::Match(tok, "%name% <<|>>") && (!tok->valueType() || !tok->valueType()->isIntegral()))
|
||||
if (_tokenizer->isCPP() && Token::Match(tok, "%name% <<|>>") && (!tok->valueType() || !tok->valueType()->isIntegral()))
|
||||
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% [")) {
|
||||
const Token *tok2 = tok->linkAt(1);
|
||||
while (Token::simpleMatch(tok2, "] ["))
|
||||
|
|
|
@ -1859,6 +1859,16 @@ private:
|
|||
" if(++start<100 && 10<=section[start]) { }\n"
|
||||
"}");
|
||||
ASSERT_EQUALS("", errout.str());
|
||||
|
||||
// daca iqtree
|
||||
check("void readNCBITree(std::istream &in) {\n"
|
||||
" char ch;\n"
|
||||
" in >> ch;\n"
|
||||
" if (ch != '|') return;\n"
|
||||
" in >> ch;\n"
|
||||
" if (ch != '|') {}\n"
|
||||
"}\n");
|
||||
ASSERT_EQUALS("", errout.str());
|
||||
}
|
||||
|
||||
// clarify conditions with = and comparison
|
||||
|
|
Loading…
Reference in New Issue