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

Method invalidContainerError

lib/checkstl.cpp:1249–1257  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1247}
1248
1249void CheckStlImpl::invalidContainerError(const Token *tok, const ValueFlow::Value *val, ErrorPath errorPath)
1250{
1251 const bool inconclusive = val ? val->isInconclusive() : false;
1252 if (val)
1253 errorPath.insert(errorPath.begin(), val->errorPath.cbegin(), val->errorPath.cend());
1254 std::string msg = "Using " + lifetimeMessage(tok, val, errorPath);
1255 errorPath.emplace_back(tok, "");
1256 reportError(std::move(errorPath), Severity::error, "invalidContainer", msg + " that may be invalid.", CWE664, inconclusive ? Certainty::inconclusive : Certainty::normal);
1257}
1258
1259void CheckStlImpl::invalidContainerReferenceError(const Token* tok, const Token* contTok, ErrorPath errorPath)
1260{

Callers 1

getErrorMessagesMethod · 0.80

Calls 3

reportErrorFunction · 0.70
isInconclusiveMethod · 0.45
beginMethod · 0.45

Tested by

no test coverage detected