diff --git a/lib/checkstl.cpp b/lib/checkstl.cpp index 1adec8287..511e6c20a 100644 --- a/lib/checkstl.cpp +++ b/lib/checkstl.cpp @@ -253,7 +253,7 @@ void CheckStl::eraseCheckLoop(const Token *it) // Error message for bad iterator usage.. void CheckStl::eraseError(const Token *tok) { - reportError(tok, Severity::error, "erase", "Dangerous usage of erase\nAfter erase has been used the iterator may be invalid so dereferencing it or comparing it with other iterator is invalid."); + reportError(tok, Severity::error, "erase", "Dangerous iterator usage. After erase the iterator is invalid so dereferencing it or comparing it with another iterator is invalid."); } diff --git a/test/teststl.cpp b/test/teststl.cpp index 093221d64..c106de737 100644 --- a/test/teststl.cpp +++ b/test/teststl.cpp @@ -269,7 +269,7 @@ private: " foo.erase(it);\n" " }\n" "}\n"); - ASSERT_EQUALS("[test.cpp:5]: (error) Dangerous usage of erase\n", errout.str()); + ASSERT_EQUALS("[test.cpp:5]: (error) Dangerous iterator usage. After erase the iterator is invalid so dereferencing it or comparing it with another iterator is invalid.\n", errout.str()); check("for (it = foo.begin(); it != foo.end(); ++it)\n" "{\n" @@ -279,7 +279,8 @@ private: "{\n" " foo.erase(it);\n" "}\n"); - ASSERT_EQUALS("[test.cpp:3]: (error) Dangerous usage of erase\n[test.cpp:7]: (error) Dangerous usage of erase\n", errout.str()); + ASSERT_EQUALS("[test.cpp:3]: (error) Dangerous iterator usage. After erase the iterator is invalid so dereferencing it or comparing it with another iterator is invalid.\n" + "[test.cpp:7]: (error) Dangerous iterator usage. After erase the iterator is invalid so dereferencing it or comparing it with another iterator is invalid.\n", errout.str()); check("void f(std::list &ints)\n" "{\n"