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

Function isSameLifetime

lib/astutils.cpp:1413–1422  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1411}
1412
1413static bool isSameLifetime(const Token * const tok1, const Token * const tok2)
1414{
1415 ValueFlow::Value v1 = ValueFlow::getLifetimeObjValue(tok1);
1416 if (!v1.isLifetimeValue())
1417 return false;
1418 ValueFlow::Value v2 = ValueFlow::getLifetimeObjValue(tok2);
1419 if (!v2.isLifetimeValue())
1420 return false;
1421 return v1.tokvalue == v2.tokvalue;
1422}
1423
1424static bool compareKnownValue(const Token * const tok1, const Token * const tok2, const std::function<bool(const ValueFlow::Value&, const ValueFlow::Value&, bool)> &compare)
1425{

Callers 1

compareKnownValueFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected