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