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

Function isNonConstPtrCast

lib/checkclass.cpp:2479–2485  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2477const std::set<std::string> CheckClassImpl::stl_containers_not_const = { "map", "unordered_map", "std :: map|unordered_map <" }; // start pattern
2478
2479static bool isNonConstPtrCast(const Token* tok)
2480{
2481 if (!tok || !tok->isCast())
2482 return false;
2483 const ValueType* vt = tok->valueType();
2484 return !vt || (vt->pointer > 0 && !vt->isConst(vt->pointer));
2485}
2486
2487bool CheckClassImpl::checkConstFunc(const Scope *scope, const Function *func, MemberAccess& memberAccessed) const
2488{

Callers 1

checkConstFuncMethod · 0.85

Calls 2

isCastMethod · 0.80
isConstMethod · 0.80

Tested by

no test coverage detected