File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -268,7 +268,7 @@ void CheckFunctions::checkIgnoredReturnValue()
268268 }
269269
270270 if ((!tok->function () || !Token::Match (tok->function ()->retDef , " void %name%" )) &&
271- ! WRONG_DATA (! tok->next ()->astOperand1 (), tok )) {
271+ tok->next ()->astOperand1 ()) {
272272 const Library::UseRetValType retvalTy = mSettings ->library .getUseRetValType (tok);
273273 const bool warn = (tok->function () && tok->function ()->isAttributeNodiscard ()) || // avoid duplicate warnings for resource-allocating functions
274274 (retvalTy == Library::UseRetValType::DEFAULT && mSettings ->library .getAllocFuncInfo (tok) == nullptr );
Original file line number Diff line number Diff line change @@ -1998,6 +1998,11 @@ class TestFunctions : public TestFixture {
19981998 " }\n " );
19991999 ASSERT_EQUALS (" " , errout.str ());
20002000
2001+ check (" void f() {\n "
2002+ " INT (*g)() = nullptr;\n "
2003+ " }\n " );
2004+ ASSERT_EQUALS (" " , errout.str ());
2005+
20012006 settings = settings_old;
20022007 }
20032008
You can’t perform that action at this time.
0 commit comments