Fixed #3634 (False positive: compareBoolExpressionWithInt when using boost::tuples)
This commit is contained in:
parent
5b0551054a
commit
77e9106ec0
|
@ -2878,6 +2878,12 @@ void CheckOther::checkComparisonOfBoolExpressionWithInt()
|
|||
const SymbolDatabase* symbolDatabase = _tokenizer->getSymbolDatabase();
|
||||
|
||||
for (const Token *tok = _tokenizer->tokens(); tok; tok = tok->next()) {
|
||||
// Skip template parameters
|
||||
if (tok->str() == "<" && tok->link()) {
|
||||
tok = tok->link();
|
||||
continue;
|
||||
}
|
||||
|
||||
const Token* numTok = 0;
|
||||
const Token* opTok = 0;
|
||||
char op = 0;
|
||||
|
|
|
@ -124,6 +124,7 @@ private:
|
|||
|
||||
TEST_CASE(comparisonOfBoolExpressionWithInt1);
|
||||
TEST_CASE(comparisonOfBoolExpressionWithInt2);
|
||||
TEST_CASE(comparisonOfBoolExpressionWithInt3);
|
||||
|
||||
TEST_CASE(incorrectStringCompare);
|
||||
|
||||
|
@ -3041,6 +3042,12 @@ private:
|
|||
ASSERT_EQUALS("", errout.str());
|
||||
}
|
||||
|
||||
void comparisonOfBoolExpressionWithInt3() {
|
||||
check("int f(int x) {\n"
|
||||
" return t<0>() && x;\n"
|
||||
"}");
|
||||
ASSERT_EQUALS("", errout.str());
|
||||
}
|
||||
|
||||
void memsetZeroBytes() {
|
||||
check("void f() {\n"
|
||||
|
|
Loading…
Reference in New Issue