diff options
Diffstat (limited to 'gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/allocator/move_assign.cc')
-rw-r--r-- | gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/allocator/move_assign.cc | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/allocator/move_assign.cc b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/allocator/move_assign.cc index 64795d361..42dec6dd8 100644 --- a/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/allocator/move_assign.cc +++ b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/allocator/move_assign.cc @@ -46,16 +46,35 @@ void test02() typedef std::vector<T, alloc_type> test_type; test_type v1(alloc_type(1)); v1.push_back(T()); + auto it = v1.begin(); test_type v2(alloc_type(2)); - v2 = std::move(v1); v2.push_back(T()); + v2 = std::move(v1); + VERIFY( it == v2.begin() ); VERIFY(0 == v1.get_allocator().get_personality()); VERIFY(1 == v2.get_allocator().get_personality()); } +void test03() +{ + bool test __attribute__((unused)) = true; + typedef propagating_allocator<T, false> alloc_type; + typedef std::vector<T, alloc_type> test_type; + test_type v1(alloc_type(1)); + v1.push_back(T()); + auto it = v1.begin(); + test_type v2(alloc_type(1)); + v2.push_back(T()); + v2 = std::move(v1); + VERIFY( it == v2.begin() ); + VERIFY(1 == v1.get_allocator().get_personality()); + VERIFY(1 == v2.get_allocator().get_personality()); +} + int main() { test01(); test02(); + test03(); return 0; } |