Fixed #2101 (list in vector iterator usage)
This commit is contained in:
parent
ba2b986ece
commit
0b6948a805
|
@ -306,8 +306,6 @@ private:
|
||||||
break;
|
break;
|
||||||
else if (token->str() == "=")
|
else if (token->str() == "=")
|
||||||
token = 0;
|
token = 0;
|
||||||
else
|
|
||||||
token = token->previous();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (token)
|
if (token)
|
||||||
|
|
|
@ -384,6 +384,16 @@ private:
|
||||||
"}\n");
|
"}\n");
|
||||||
ASSERT_EQUALS("", errout.str());
|
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()
|
void erase2()
|
||||||
|
|
Loading…
Reference in New Issue