From aab06eaeab532912cafa44a74684647d3fb0a884 Mon Sep 17 00:00:00 2001 From: Slava Semushin Date: Sat, 18 Jul 2009 17:06:51 +0700 Subject: [PATCH] Fixed ticket #477 (Bug in Token::Match() during process TestStl::pushback3) http://sourceforge.net/apps/trac/cppcheck/ticket/477 --- test/teststl.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/test/teststl.cpp b/test/teststl.cpp index 2758317c5..3faa450b7 100644 --- a/test/teststl.cpp +++ b/test/teststl.cpp @@ -317,13 +317,15 @@ private: { check("void f()\n" "{\n" - " std::vector::const_iterator it = foo.begin();\n" + " std::vector foo;\n" + " foo.push_back(10);\n" + " std::vector::iterator it;\n" " for (it = foo.begin(); it != foo.end(); ++it)\n" " {\n" " foo.push_back(123);\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()