Fixed #2101 (list in vector iterator usage)

This commit is contained in:
Daniel Marjamäki 2010-10-15 18:11:41 +02:00
parent ba2b986ece
commit 0b6948a805
2 changed files with 10 additions and 2 deletions

View File

@ -306,8 +306,6 @@ private:
break;
else if (token->str() == "=")
token = 0;
else
token = token->previous();
}
if (token)

View File

@ -384,6 +384,16 @@ private:
"}\n");
ASSERT_EQUALS("", errout.str());
// #2101
check("void f(vector< list<int> > &ints, unsigned int i)\n"
"{\n"
" list<int>::iterator it;\n"
" for(it = ints[i].begin(); it != ints[i].end(); it++) {\n"
" if (*it % 2)\n"
" it = ints[i].erase(it);\n"
" }\n"
"}\n");
ASSERT_EQUALS("", errout.str());
}
void erase2()