Make std::deque meet C++11 allocator requirements.
authorJonathan Wakely <jwakely@redhat.com>
Tue, 9 Sep 2014 17:29:32 +0000 (18:29 +0100)
committerJonathan Wakely <redi@gcc.gnu.org>
Tue, 9 Sep 2014 17:29:32 +0000 (18:29 +0100)
commitfd18c76ac8c85976bd7fe413aca2c26296ca6d54
tree55818653d7216532f7c0186498ada0fe0a1ece63
parente8a54173bc7575981beaa9ccd44400c085ed74ff
Make std::deque meet C++11 allocator requirements.

* include/bits/deque.tcc (deque::operator=(const deque&)): Handle
allocator propagation.
(deque::emplace_front, deque::emplace_back): Use allocator traits.
(deque::_M_push_back_aux, deque::_M_push_front_aux): Likewise.
(deque::_M_pop_back_aux, deque::_M_pop_front_aux): Likewise.
* include/bits/stl_deque.h (__deque_buf_size): Add constexpr.
(_Deque_iterator): Handle allocators with custom pointers.
(_Deque_base): Likewise. Use allocator traits.
(deque): Likewise. Add allocator-extended constructors.
(deque::_M_move_assign1, deque::_M_move_assign2): Implement move
assignment via tag dispatching.
(deque::_M_replace_map): Replace existing data.
* include/debug/deque (deque): Add allocator-extended constructors.
* include/profile/deque (deque): Likewise.
* testsuite/23_containers/deque/allocator/copy.cc: New.
* testsuite/23_containers/deque/allocator/copy_assign.cc: New.
* testsuite/23_containers/deque/allocator/ext_ptr.cc: New.
* testsuite/23_containers/deque/allocator/minimal.cc: New.
* testsuite/23_containers/deque/allocator/move.cc: New.
* testsuite/23_containers/deque/allocator/move_assign-2.cc: New.
* testsuite/23_containers/deque/allocator/move_assign.cc: New.
* testsuite/23_containers/deque/allocator/noexcept.cc: New.
* testsuite/23_containers/deque/allocator/swap.cc: New.
* testsuite/23_containers/deque/requirements/dr438/assign_neg.cc:
Adjust dg-error line number.
* testsuite/23_containers/deque/requirements/dr438/
constructor_1_neg.cc: Likewise.
* testsuite/23_containers/deque/requirements/dr438/
constructor_2_neg.cc: Likewise.
* testsuite/23_containers/deque/requirements/dr438/insert_neg.cc:
Likewise.
* testsuite/23_containers/vector/52591.cc: Test both the propagating
and always-equal cases.

From-SVN: r215090
19 files changed:
libstdc++-v3/ChangeLog
libstdc++-v3/include/bits/deque.tcc
libstdc++-v3/include/bits/stl_deque.h
libstdc++-v3/include/debug/deque
libstdc++-v3/include/profile/deque
libstdc++-v3/testsuite/23_containers/deque/allocator/copy.cc [new file with mode: 0644]
libstdc++-v3/testsuite/23_containers/deque/allocator/copy_assign.cc [new file with mode: 0644]
libstdc++-v3/testsuite/23_containers/deque/allocator/ext_ptr.cc [new file with mode: 0644]
libstdc++-v3/testsuite/23_containers/deque/allocator/minimal.cc [new file with mode: 0644]
libstdc++-v3/testsuite/23_containers/deque/allocator/move.cc [new file with mode: 0644]
libstdc++-v3/testsuite/23_containers/deque/allocator/move_assign-2.cc [new file with mode: 0644]
libstdc++-v3/testsuite/23_containers/deque/allocator/move_assign.cc [new file with mode: 0644]
libstdc++-v3/testsuite/23_containers/deque/allocator/noexcept.cc [new file with mode: 0644]
libstdc++-v3/testsuite/23_containers/deque/allocator/swap.cc [new file with mode: 0644]
libstdc++-v3/testsuite/23_containers/deque/requirements/dr438/assign_neg.cc
libstdc++-v3/testsuite/23_containers/deque/requirements/dr438/constructor_1_neg.cc
libstdc++-v3/testsuite/23_containers/deque/requirements/dr438/constructor_2_neg.cc
libstdc++-v3/testsuite/23_containers/deque/requirements/dr438/insert_neg.cc
libstdc++-v3/testsuite/23_containers/vector/52591.cc