Add std::vector::emplace() testcase from LWG 2164

* testsuite/23_containers/vector/modifiers/emplace/self_emplace.cc:
	Add testcase from LWG 2164.

From-SVN: r238243
This commit is contained in:
Jonathan Wakely 2016-07-12 15:00:11 +01:00 committed by Jonathan Wakely
parent 37ccb0bacb
commit 17b31c054c
2 changed files with 19 additions and 0 deletions

View File

@ -1,3 +1,8 @@
2016-07-12 Jonathan Wakely <jwakely@redhat.com>
* testsuite/23_containers/vector/modifiers/emplace/self_emplace.cc:
Add testcase from LWG 2164.
2016-07-11 François Dumont <fdumont@gcc.gnu.org>
* include/bits/stl_vector.h (push_back(const value_type&)): Forward

View File

@ -135,6 +135,20 @@ test04()
VERIFY( va[0]._i == 1 );
}
void
test05()
{
// LWG DR 2164
std::vector<int> v;
v.reserve(4);
v = { 1, 2, 3 };
v.emplace(v.begin(), v.back());
VERIFY( v[0] == 3 );
VERIFY( v[1] == 1 );
VERIFY( v[2] == 2 );
VERIFY( v[3] == 3 );
}
int main()
{
test01();