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

Function hasUniqueOwnership

lib/valueflow.cpp:1480–1494  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1478}
1479
1480static bool hasUniqueOwnership(const Token* tok)
1481{
1482 if (!tok)
1483 return false;
1484 const Variable* var = tok->variable();
1485 if (var && var->isArray() && !var->isArgument())
1486 return true;
1487 if (astIsPointer(tok))
1488 return false;
1489 if (astIsUniqueSmartPointer(tok))
1490 return true;
1491 if (astIsContainerOwned(tok))
1492 return true;
1493 return false;
1494}
1495
1496// Check if dereferencing an object that doesn't have unique ownership
1497static bool derefShared(const Token* tok)

Callers 1

derefSharedFunction · 0.85

Calls 5

astIsPointerFunction · 0.85
astIsUniqueSmartPointerFunction · 0.85
astIsContainerOwnedFunction · 0.85
variableMethod · 0.80
isArrayMethod · 0.80

Tested by

no test coverage detected