diff options
author | François Dumont <fdumont@gcc.gnu.org> | 2013-03-08 20:08:20 +0000 |
---|---|---|
committer | François Dumont <fdumont@gcc.gnu.org> | 2013-03-08 20:08:20 +0000 |
commit | 68d047cb48654a89da139e03c6c5e424734a194e (patch) | |
tree | ee1852eb35cadccb3742d5a9dfee615de4b02cba /libstdc++-v3/testsuite/23_containers/forward_list/allocator/copy.cc | |
parent | 6384c29bfc15a772d876f5e26b68808560cf0ac3 (diff) | |
download | gcc-68d047cb48654a89da139e03c6c5e424734a194e.tar.gz |
vector.tcc (vector<>operator=(const vector<>&): Reset pointers after deallocation when memory can be reused.
2013-03-08 François Dumont <fdumont@gcc.gnu.org>
* include/bits/vector.tcc (vector<>operator=(const vector<>&):
Reset pointers after deallocation when memory can be reused.
* testsuite/23_containers/vector/allocator/minimal.cc: Insert
elements to really challenge C++11 allocator integration.
* testsuite/23_containers/vector/allocator/copy.cc: Likewise.
* testsuite/23_containers/vector/allocator/copy_assign.cc:
Likewise.
* testsuite/23_containers/vector/allocator/move_assign.cc:
Likewise.
* testsuite/23_containers/vector/allocator/swap.cc: Likewise and
swap vector back before checks on memory/personality mapping are
performed.
* testsuite/23_containers/forward_list/allocator/minimal.cc:
Insert element to really challenge C++11 allocator integration.
* testsuite/23_containers/forward_list/allocator/copy.cc:
Likewise.
* testsuite/23_containers/forward_list/allocator/copy_assign.cc:
Likewise.
* testsuite/23_containers/forward_list/allocator/move_assign.cc:
Likewise.
* testsuite/23_containers/forward_list/allocator/swap.cc: Likewise
and swap forward_list back before checks on memory/personality
mapping are performed.
From-SVN: r196557
Diffstat (limited to 'libstdc++-v3/testsuite/23_containers/forward_list/allocator/copy.cc')
-rw-r--r-- | libstdc++-v3/testsuite/23_containers/forward_list/allocator/copy.cc | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libstdc++-v3/testsuite/23_containers/forward_list/allocator/copy.cc b/libstdc++-v3/testsuite/23_containers/forward_list/allocator/copy.cc index 0c66c5153f2..f7e781ce9ec 100644 --- a/libstdc++-v3/testsuite/23_containers/forward_list/allocator/copy.cc +++ b/libstdc++-v3/testsuite/23_containers/forward_list/allocator/copy.cc @@ -31,6 +31,7 @@ void test01() typedef propagating_allocator<T, false> alloc_type; typedef std::forward_list<T, alloc_type> test_type; test_type v1(alloc_type(1)); + v1.push_front(T()); test_type v2(v1); VERIFY(1 == v1.get_allocator().get_personality()); VERIFY(0 == v2.get_allocator().get_personality()); @@ -42,6 +43,7 @@ void test02() typedef propagating_allocator<T, true> alloc_type; typedef std::forward_list<T, alloc_type> test_type; test_type v1(alloc_type(1)); + v1.push_front(T()); test_type v2(v1); VERIFY(1 == v1.get_allocator().get_personality()); VERIFY(1 == v2.get_allocator().get_personality()); |