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

Method mismatchingContainersError

lib/checkstl.cpp:651–661  ·  view source on GitHub ↗

Error message for bad iterator usage..

Source from the content-addressed store, hash-verified

649
650// Error message for bad iterator usage..
651void CheckStlImpl::mismatchingContainersError(const Token* tok1, const Token* tok2)
652{
653 const std::string expr1(tok1 ? tok1->expressionString() : std::string("v1"));
654 const std::string expr2(tok2 ? tok2->expressionString() : std::string("v2"));
655 reportError(tok1,
656 Severity::error,
657 "mismatchingContainers",
658 "Iterators of different containers '" + expr1 + "' and '" + expr2 + "' are used together.",
659 CWE664,
660 Certainty::normal);
661}
662
663void CheckStlImpl::mismatchingContainerExpressionError(const Token *tok1, const Token *tok2)
664{

Callers 1

getErrorMessagesMethod · 0.80

Calls 2

reportErrorFunction · 0.70
expressionStringMethod · 0.45

Tested by

no test coverage detected