Fix FP ignoredReturnValue (#4783)
This commit is contained in:
parent
132a5a31cf
commit
2379239aed
|
@ -254,7 +254,7 @@ void CheckFunctions::checkIgnoredReturnValue()
|
|||
|
||||
const Token *parent = tok->next()->astParent();
|
||||
while (Token::Match(parent, "%cop%")) {
|
||||
if (Token::Match(parent, "<<|>>") && !parent->astParent())
|
||||
if (Token::Match(parent, "<<|>>|*") && !parent->astParent())
|
||||
break;
|
||||
parent = parent->astParent();
|
||||
}
|
||||
|
|
|
@ -1451,6 +1451,10 @@ private:
|
|||
"}", "test.cpp", &settings2);
|
||||
ASSERT_EQUALS("[test.cpp:2]: (warning) Return value of function mystrcmp() is not used.\n", errout.str());
|
||||
|
||||
check("void f(std::vector<int*> v) {\n"
|
||||
" delete *v.begin();\n"
|
||||
"}\n");
|
||||
ASSERT_EQUALS("", errout.str());
|
||||
}
|
||||
|
||||
void checkIgnoredErrorCode() {
|
||||
|
|
Loading…
Reference in New Issue