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

Method mismatchingContainerExpressionError

lib/checkstl.cpp:663–670  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

661}
662
663void CheckStlImpl::mismatchingContainerExpressionError(const Token *tok1, const Token *tok2)
664{
665 const std::string expr1(tok1 ? tok1->expressionString() : std::string("v1"));
666 const std::string expr2(tok2 ? tok2->expressionString() : std::string("v2"));
667 reportError(tok1, Severity::warning, "mismatchingContainerExpression",
668 "Iterators to containers from different expressions '" +
669 expr1 + "' and '" + expr2 + "' are used together.", CWE664, Certainty::normal);
670}
671
672void CheckStlImpl::sameIteratorExpressionError(const Token *tok)
673{

Callers 1

getErrorMessagesMethod · 0.80

Calls 2

reportErrorFunction · 0.70
expressionStringMethod · 0.45

Tested by

no test coverage detected