diff --git a/lib/checkfunctions.cpp b/lib/checkfunctions.cpp index a521f14b4..888798fe1 100644 --- a/lib/checkfunctions.cpp +++ b/lib/checkfunctions.cpp @@ -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(); } diff --git a/test/testfunctions.cpp b/test/testfunctions.cpp index a79715dfd..937d2c57f 100644 --- a/test/testfunctions.cpp +++ b/test/testfunctions.cpp @@ -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 v) {\n" + " delete *v.begin();\n" + "}\n"); + ASSERT_EQUALS("", errout.str()); } void checkIgnoredErrorCode() {