Merge branch 'master' of git@github.com:danmar/cppcheck

This commit is contained in:
Kimmo Varis 2009-07-18 13:37:21 +03:00
commit 69cbacfc87
1 changed files with 4 additions and 2 deletions

View File

@ -317,13 +317,15 @@ private:
{ {
check("void f()\n" check("void f()\n"
"{\n" "{\n"
" std::vector<int>::const_iterator it = foo.begin();\n" " std::vector<int> foo;\n"
" foo.push_back(10);\n"
" std::vector<int>::iterator it;\n"
" for (it = foo.begin(); it != foo.end(); ++it)\n" " for (it = foo.begin(); it != foo.end(); ++it)\n"
" {\n" " {\n"
" foo.push_back(123);\n" " foo.push_back(123);\n"
" }\n" " }\n"
"}\n"); "}\n");
ASSERT_EQUALS("[test.cpp:6]: (error) After push_back or push_front, the iterator 'it' may be invalid\n", errout.str()); ASSERT_EQUALS("[test.cpp:8]: (error) After push_back or push_front, the iterator 'it' may be invalid\n", errout.str());
} }
void pushback4() void pushback4()