parent
29a5404d1e
commit
0efddc4010
|
@ -1444,8 +1444,8 @@ void CheckOther::checkIncompleteStatement()
|
||||||
if (isVoidStmt(tok))
|
if (isVoidStmt(tok))
|
||||||
continue;
|
continue;
|
||||||
if (mTokenizer->isCPP() && tok->str() == "&" && !(tok->astOperand1()->valueType() && tok->astOperand1()->valueType()->isIntegral()))
|
if (mTokenizer->isCPP() && tok->str() == "&" && !(tok->astOperand1()->valueType() && tok->astOperand1()->valueType()->isIntegral()))
|
||||||
// Possible archive
|
// Possible archive
|
||||||
continue;
|
continue;
|
||||||
bool inconclusive = Token::Match(tok, "%cop%");
|
bool inconclusive = Token::Match(tok, "%cop%");
|
||||||
if (mSettings->inconclusive || !inconclusive)
|
if (mSettings->inconclusive || !inconclusive)
|
||||||
constStatementError(tok, tok->isNumber() ? "numeric" : "string", inconclusive);
|
constStatementError(tok, tok->isNumber() ? "numeric" : "string", inconclusive);
|
||||||
|
|
|
@ -368,17 +368,17 @@ private:
|
||||||
ASSERT_EQUALS("", errout.str());
|
ASSERT_EQUALS("", errout.str());
|
||||||
}
|
}
|
||||||
|
|
||||||
void archive() {
|
void archive() {
|
||||||
check("void f(Archive &ar) {\n"
|
check("void f(Archive &ar) {\n"
|
||||||
" ar & x;\n"
|
" ar & x;\n"
|
||||||
"}", true);
|
"}", true);
|
||||||
ASSERT_EQUALS("", errout.str());
|
ASSERT_EQUALS("", errout.str());
|
||||||
|
|
||||||
check("void f(int ar) {\n"
|
check("void f(int ar) {\n"
|
||||||
" ar & x;\n"
|
" ar & x;\n"
|
||||||
"}", true);
|
"}", true);
|
||||||
ASSERT_EQUALS("[test.cpp:2]: (warning, inconclusive) Found suspicious operator '&'\n", errout.str());
|
ASSERT_EQUALS("[test.cpp:2]: (warning, inconclusive) Found suspicious operator '&'\n", errout.str());
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
REGISTER_TEST(TestIncompleteStatement)
|
REGISTER_TEST(TestIncompleteStatement)
|
||||||
|
|
Loading…
Reference in New Issue