MCPcopy Create free account
hub / github.com/cppcheck-opensource/cppcheck / setFunctionReturnValue

Function setFunctionReturnValue

lib/valueflow.cpp:5814–5829  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5812}
5813
5814static void setFunctionReturnValue(const Function* f,
5815 Token* tok,
5816 ValueFlow::Value v,
5817 const Settings& settings,
5818 bool known = true)
5819{
5820 if (f->hasVirtualSpecifier()) {
5821 if (v.isImpossible())
5822 return;
5823 v.setPossible();
5824 } else if (!v.isImpossible() && known) {
5825 v.setKnown();
5826 }
5827 v.errorPath.emplace_back(tok, "Calling function '" + f->name() + "' returns " + v.toString());
5828 setTokenValue(tok, std::move(v), settings);
5829}
5830
5831static void valueFlowFunctionReturn(TokenList& tokenlist, ErrorLogger& errorLogger, const Settings& settings)
5832{

Callers 1

valueFlowFunctionReturnFunction · 0.85

Calls 4

setTokenValueFunction · 0.85
isImpossibleMethod · 0.80
nameMethod · 0.45
toStringMethod · 0.45

Tested by

no test coverage detected