diff --git a/test/teststl.cpp b/test/teststl.cpp index 8f08c0edf..c10337188 100644 --- a/test/teststl.cpp +++ b/test/teststl.cpp @@ -47,6 +47,7 @@ private: TEST_CASE(eraseGoto); TEST_CASE(eraseAssign); TEST_CASE(eraseDereference); + TEST_CASE(eraseErase); TEST_CASE(pushback1); TEST_CASE(pushback2); @@ -267,6 +268,18 @@ private: TODO_ASSERT_EQUALS("[test.cpp:6]: (error) Dereferencing invalid iterator\n", errout.str()); } + void eraseErase() + { + check("void f(std::vector &ints)\n" + "{\n" + " std::vector::iterator iter;\n" + " iter = ints.begin() + 2;\n" + " ints.erase(iter);\n" + " ints.erase(iter);\n" + "}\n"); + TODO_ASSERT_EQUALS("[test.cpp:6]: (error) Erasing invalid iterator\n", errout.str()); + } + void pushback1()