std.cfg: Added more tests for some std::vector functions.

This commit is contained in:
orbitcowboy 2018-04-11 17:21:26 +02:00
parent 7176632bc6
commit ef62207ada
2 changed files with 12 additions and 0 deletions

View File

@ -6056,6 +6056,7 @@ The obsolete function 'gets' is called. With 'gets' you'll get a buffer overrun
</function>
<function name="std::list::pop_back,std::list::pop_front,std::forward_list::pop_front,std::vector::pop_back">
<noreturn>false</noreturn>
<returnValue type="void"/>
</function>
<function name="std::stack::pop,std::queue::pop">
<noreturn>false</noreturn>

View File

@ -3267,7 +3267,18 @@ void stdstring()
void stdvector()
{
int uninit;
std::vector<int> v;
// cppcheck-suppress ignoredReturnValue
v.size();
// cppcheck-suppress uninitvar
v.push_back(uninit);
// no warning is expected for pop_back()
v.push_back(42);
v.pop_back();
v.push_back(42);
// cppcheck-suppress ignoredReturnValue
v.back();
}