Hi,
cppcheck reports an incorrect mismatchingContainerExpression warning for the following code, which has a member function called end().
class foo { int m_bar; public: foo(int bar) : m_bar(bar) {} int end() { return m_bar; } }; int main() { foo first(1); foo second(2); if (first.end() == second.end()) return 1; return 0; }
Warning:
end.cxx:16:7: warning: Iterators to containers from different expressions 'first' and 'second' are used together. [mismatchingContainerExpression] if (first.end() == second.end())
Thanks
Ouch! I have created this ticket: https://trac.cppcheck.net/ticket/10012#ticket
Log in to post a comment.
Hi,
cppcheck reports an incorrect mismatchingContainerExpression warning for the following code, which has a member function called end().
Warning:
Thanks
Ouch! I have created this ticket:
https://trac.cppcheck.net/ticket/10012#ticket