File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 4040#include < iostream>
4141#include < istream>
4242#include < iterator>
43+ #include < list>
4344#include < map>
4445#include < memory>
4546#include < mutex>
@@ -5190,6 +5191,23 @@ void unreadVariable_std_format_error(char * c)
51905191}
51915192#endif
51925193
5194+ void eraseIteratorOutOfBounds_std_list1 ()
5195+ {
5196+ std::list<int > a;
5197+ std::list<int >::iterator p = a.begin ();
5198+ // cppcheck-suppress eraseIteratorOutOfBounds
5199+ a.erase (p);
5200+ }
5201+ int eraseIteratorOutOfBounds_std_list2 ()
5202+ {
5203+ std::list<int > a;
5204+ std::list<int >::iterator p = a.begin ();
5205+ std::list<int >::iterator q = p;
5206+ // cppcheck-suppress eraseIteratorOutOfBounds
5207+ a.erase (q);
5208+ return *q;
5209+ }
5210+
51935211void containerOutOfBounds_std_string (std::string &var) { // #11403
51945212 std::string s0{" x" };
51955213 // cppcheck-suppress containerOutOfBounds
You can’t perform that action at this time.
0 commit comments