summaryrefslogtreecommitdiff
path: root/libstdc++-v3/testsuite/23_containers/forward_list/allocator/copy.cc
diff options
context:
space:
mode:
authorJonathan Wakely <jwakely.gcc@gmail.com>2013-11-15 15:34:14 +0000
committerJonathan Wakely <redi@gcc.gnu.org>2013-11-15 15:34:14 +0000
commitff90a89e480d318bbb1a09fca1ea76c1a86e3ebb (patch)
tree8d74c7399d7ca47a8c91d1e7e04159421d2f077b /libstdc++-v3/testsuite/23_containers/forward_list/allocator/copy.cc
parent9cc65f15c42dd3a8f88764ce893cd2c9004801dd (diff)
downloadgcc-ff90a89e480d318bbb1a09fca1ea76c1a86e3ebb.tar.gz
stl_map.h (map): Implement C++11 allocator-aware container requirements.
* include/bits/stl_map.h (map): Implement C++11 allocator-aware container requirements. * include/bits/stl_multimap.h (multimap): Likewise. * include/bits/stl_multiset.h (multiset): Likewise. * include/bits/stl_set.h (set): Likewise. * include/bits/stl_tree.h (_Rb_tree_node): Use __aligned_buffer and add accessors for value. (_Rb_tree_iterator, _Rb_tree_const_iterator): Use _Rb_tree_node accessors. (_Rb_tree): Use allocator_traits and implement support for sets and maps the be allocator-aware. * include/bits/forward_list.h (_Fwd_list_base::_M_create_node): Do not zero-initialize storage buffer. * include/bits/hashtable_policy.h (_Hashtable_alloc::_M_allocate_node): Likewise. * include/bits/stl_vector.h (vector(vector&&, const allocator_type&)): Add conditional noexcept specification. * doc/xml/manual/status_cxx2011.xml: Update status of containers. * testsuite/util/testsuite_allocator.h: Re-indent. * testsuite/23_containers/forward_list/allocator/copy.cc: Test allocator-extended copy constructor. * testsuite/23_containers/unordered_map/allocator/copy.cc: Likewise. * testsuite/23_containers/unordered_multimap/allocator/copy.cc: Likewise. * testsuite/23_containers/unordered_multiset/allocator/copy.cc: Likewise. * testsuite/23_containers/unordered_set/allocator/copy.cc: Likewise. * testsuite/23_containers/vector/allocator/copy.cc: Likewise. * testsuite/23_containers/forward_list/allocator/move.cc: New. * testsuite/23_containers/unordered_map/allocator/move.cc: New. * testsuite/23_containers/unordered_multimap/allocator/move.cc: New. * testsuite/23_containers/unordered_multiset/allocator/move.cc: New. * testsuite/23_containers/unordered_set/allocator/move.cc: New. * testsuite/23_containers/vector/allocator/move.cc: New. * testsuite/23_containers/map/allocator/copy.cc: New. * testsuite/23_containers/map/allocator/copy_assign.cc: New. * testsuite/23_containers/map/allocator/minimal.cc: New. * testsuite/23_containers/map/allocator/move.cc: New. * testsuite/23_containers/map/allocator/move_assign.cc: New. * testsuite/23_containers/map/allocator/noexcept.cc: New. * testsuite/23_containers/map/allocator/swap.cc: New. * testsuite/23_containers/multimap/allocator/copy.cc: New. * testsuite/23_containers/multimap/allocator/copy_assign.cc: New. * testsuite/23_containers/multimap/allocator/minimal.cc: New. * testsuite/23_containers/multimap/allocator/move.cc: New. * testsuite/23_containers/multimap/allocator/move_assign.cc: New. * testsuite/23_containers/multimap/allocator/noexcept.cc: New. * testsuite/23_containers/multimap/allocator/swap.cc: New. * testsuite/23_containers/multiset/allocator/copy.cc: New. * testsuite/23_containers/multiset/allocator/copy_assign.cc: New. * testsuite/23_containers/multiset/allocator/minimal.cc: New. * testsuite/23_containers/multiset/allocator/move.cc: New. * testsuite/23_containers/multiset/allocator/move_assign.cc: New. * testsuite/23_containers/multiset/allocator/noexcept.cc: New. * testsuite/23_containers/multiset/allocator/swap.cc: New. * testsuite/23_containers/set/allocator/copy.cc: New. * testsuite/23_containers/set/allocator/copy_assign.cc: New. * testsuite/23_containers/set/allocator/minimal.cc: New. * testsuite/23_containers/set/allocator/move.cc: New. * testsuite/23_containers/set/allocator/move_assign.cc: New. * testsuite/23_containers/set/allocator/noexcept.cc: New. * testsuite/23_containers/set/allocator/swap.cc: New. * testsuite/23_containers/vector/requirements/dr438/assign_neg.cc: Adjust dg-error line number. * testsuite/23_containers/vector/requirements/dr438/ constructor_1_neg.cc: Likewise. * testsuite/23_containers/vector/requirements/dr438/ constructor_2_neg.cc: Likewise. * testsuite/23_containers/vector/requirements/dr438/insert_neg.cc: Likewise. From-SVN: r204848
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.cc15
1 files changed, 14 insertions, 1 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 f7e781ce9ec..c08e0e105a2 100644
--- a/libstdc++-v3/testsuite/23_containers/forward_list/allocator/copy.cc
+++ b/libstdc++-v3/testsuite/23_containers/forward_list/allocator/copy.cc
@@ -15,7 +15,7 @@
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
-// { dg-options "-std=gnu++0x" }
+// { dg-options "-std=gnu++11" }
#include <forward_list>
#include <testsuite_hooks.h>
@@ -49,9 +49,22 @@ void test02()
VERIFY(1 == v2.get_allocator().get_personality());
}
+void test03()
+{
+ bool test __attribute__((unused)) = true;
+ 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, alloc_type(2));
+ VERIFY(1 == v1.get_allocator().get_personality());
+ VERIFY(2 == v2.get_allocator().get_personality());
+}
+
int main()
{
test01();
test02();
+ test03();
return 0;
}