From 43308b7e11b2c491063a4670effa18588b07037f Mon Sep 17 00:00:00 2001 From: bkoz Date: Tue, 25 Aug 2009 22:29:08 +0000 Subject: 2009-08-25 Benjamin Kosnik * include/bits/basic_string.h (basic_string): Add cbegin(), cend(), crbegin(), crend() in C++0x mode. * config/abi/pre/gnu.ver: Add exports. * testsuite/util/testsuite_containers.h: New. * testsuite/util/testsuite_container_traits.h: New. * testsuite/21_strings/basic_string/requirements/citerators.cc: New. * testsuite/21_strings/basic_string/requirements/typedefs.cc: New. * testsuite/ext/vstring/requirements/citerators.cc: Edit. * testsuite/ext/vstring/requirements/typedefs.cc: New. * testsuite/23_containers/unordered_map/requirements/ cliterators.cc: Edit. * testsuite/23_containers/unordered_map/requirements/ citerators.cc: Edit. * testsuite/23_containers/unordered_map/requirements/ explicit_instantiation/1.cc: New. * testsuite/23_containers/unordered_map/requirements/ explicit_instantiation/2.cc: New. * testsuite/23_containers/unordered_map/requirements/ explicit_instantiation/3.cc: New. * testsuite/23_containers/unordered_map/requirements/typedefs.cc: Edit. * testsuite/23_containers/unordered_map/requirements/ explicit_instantiation.cc: Move to nested directory. * testsuite/23_containers/queue/requirements/typedefs.cc: New. * testsuite/23_containers/priority_queue/requirements/typedefs.cc: New. * testsuite/23_containers/multimap/requirements/citerators.cc: Edit. * testsuite/23_containers/multimap/requirements/typedefs.cc: New. * testsuite/23_containers/set/requirements/citerators.cc: Edit. * testsuite/23_containers/set/requirements/typedefs.cc: New. * testsuite/23_containers/unordered_multimap/requirements/ cliterators.cc: Edit. * testsuite/23_containers/unordered_multimap/requirements/ citerators.cc: Edit. * testsuite/23_containers/unordered_multimap/requirements/ explicit_instantiation/1.cc: New. * testsuite/23_containers/unordered_multimap/requirements/ explicit_instantiation/2.cc: Edit.: New. * testsuite/23_containers/unordered_multimap/requirements/ explicit_instantiation/3.cc: New. * testsuite/23_containers/unordered_multimap/requirements/ typedefs.cc: Edit. * testsuite/23_containers/unordered_multimap/requirements/ explicit_instantiation.cc: Move to nested. * testsuite/23_containers/forward_list/requirements/citerators.cc: New. * testsuite/23_containers/forward_list/requirements/1.cc: Remove. * testsuite/23_containers/forward_list/requirements/dr438/ insert_neg.cc: New. * testsuite/23_containers/forward_list/requirements/dr438/ assign_neg.cc: New. * testsuite/23_containers/forward_list/requirements/dr438/ constructor_1_neg.cc: New. * testsuite/23_containers/forward_list/requirements/dr438/ constructor_2_neg.cc: New. * testsuite/23_containers/forward_list/requirements/dr438/ constructor.cc: New. * testsuite/23_containers/forward_list/requirements/typedefs.cc: New. * testsuite/23_containers/unordered_set/requirements/ cliterators.cc: Edit. * testsuite/23_containers/unordered_set/requirements/ citerators.cc: Edit. * testsuite/23_containers/unordered_set/requirements/ explicit_instantiation/1.cc: New. * testsuite/23_containers/unordered_set/requirements/ explicit_instantiation/2.cc: New. * testsuite/23_containers/unordered_set/requirements/ explicit_instantiation/3.cc: New. * testsuite/23_containers/unordered_set/requirements/typedefs.cc: Edit. * testsuite/23_containers/unordered_set/requirements/ explicit_instantiation.cc: Move to nested. * testsuite/23_containers/vector/requirements/citerators.cc: Edit. * testsuite/23_containers/vector/requirements/dr438/bool/ constructor.cc: Move. * testsuite/23_containers/vector/requirements/typedefs.cc: New. * testsuite/23_containers/vector/bool/requirements/citerators.cc: Edit. * testsuite/23_containers/vector/bool/requirements/dr438/ constructor.cc: New. * testsuite/23_containers/deque/requirements/citerators.cc: Edit. * testsuite/23_containers/deque/requirements/typedefs.cc * testsuite/23_containers/stack/requirements/typedefs.cc * testsuite/23_containers/multiset/requirements/citerators.cc: Edit. * testsuite/23_containers/multiset/requirements/typedefs.cc: New. * testsuite/23_containers/list/requirements/citerators.cc: Edit. * testsuite/23_containers/list/requirements/typedefs.cc: New. * testsuite/23_containers/unordered_multiset/requirements/ cliterators.cc: Edit. * testsuite/23_containers/unordered_multiset/requirements/ citerators.cc: Edit. * testsuite/23_containers/unordered_multiset/requirements/ explicit_instantiation.cc: Move. * testsuite/23_containers/unordered_multiset/requirements/ explicit_instantiation/1.cc: New. * testsuite/23_containers/unordered_multiset/requirements/ explicit_instantiation/2.cc: New. * testsuite/23_containers/unordered_multiset/requirements/ explicit_instantiation/3.cc: New. * testsuite/23_containers/unordered_multiset/requirements/typedefs.cc * testsuite/23_containers/map/requirements/citerators.cc: Edit. * testsuite/23_containers/map/requirements/typedefs.cc: New. * testsuite/23_containers/array/requirements/citerators.cc: Edit. * testsuite/23_containers/array/requirements/explicit_instantiation.cc: Move. * testsuite/23_containers/array/requirements/ explicit_instantiation/1.cc: New. * testsuite/23_containers/array/requirements/ explicit_instantiation/2.cc: New. * testsuite/23_containers/array/requirements/typedefs.cc: New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@151106 138bc75d-0d04-0410-961f-82ee72b054a4 --- .../unordered_map/requirements/citerators.cc | 19 +++---------- .../unordered_map/requirements/cliterators.cc | 22 ++++----------- .../requirements/explicit_instantiation.cc | 23 ---------------- .../requirements/explicit_instantiation/1.cc | 23 ++++++++++++++++ .../requirements/explicit_instantiation/2.cc | 28 +++++++++++++++++++ .../requirements/explicit_instantiation/3.cc | 24 +++++++++++++++++ .../unordered_map/requirements/typedefs.cc | 31 ++++------------------ 7 files changed, 89 insertions(+), 81 deletions(-) delete mode 100644 libstdc++-v3/testsuite/23_containers/unordered_map/requirements/explicit_instantiation.cc create mode 100644 libstdc++-v3/testsuite/23_containers/unordered_map/requirements/explicit_instantiation/1.cc create mode 100644 libstdc++-v3/testsuite/23_containers/unordered_map/requirements/explicit_instantiation/2.cc create mode 100644 libstdc++-v3/testsuite/23_containers/unordered_map/requirements/explicit_instantiation/3.cc (limited to 'libstdc++-v3/testsuite/23_containers/unordered_map/requirements') diff --git a/libstdc++-v3/testsuite/23_containers/unordered_map/requirements/citerators.cc b/libstdc++-v3/testsuite/23_containers/unordered_map/requirements/citerators.cc index b8f9d502a0d..a00635a568f 100644 --- a/libstdc++-v3/testsuite/23_containers/unordered_map/requirements/citerators.cc +++ b/libstdc++-v3/testsuite/23_containers/unordered_map/requirements/citerators.cc @@ -19,24 +19,13 @@ // with this library; see the file COPYING3. If not see // . - #include -#include - -void -test01() -{ - bool test __attribute__((unused)) = true; - - std::unordered_map um; - um[1] = 1; - VERIFY( um.cbegin() == um.begin() ); - VERIFY( um.cend() == um.end() ); - VERIFY( um.cbegin() != um.cend() ); -} +#include int main() { - test01(); + typedef std::unordered_map test_type; + __gnu_test::citerator test; return 0; } + diff --git a/libstdc++-v3/testsuite/23_containers/unordered_map/requirements/cliterators.cc b/libstdc++-v3/testsuite/23_containers/unordered_map/requirements/cliterators.cc index a6729a314be..3cad0a16a06 100644 --- a/libstdc++-v3/testsuite/23_containers/unordered_map/requirements/cliterators.cc +++ b/libstdc++-v3/testsuite/23_containers/unordered_map/requirements/cliterators.cc @@ -19,26 +19,14 @@ // with this library; see the file COPYING3. If not see // . - #include -#include - -// DR 691. -void test01() -{ - bool test __attribute__((unused)) = true; - - typedef std::unordered_map um_type; - um_type um; - um[1] = 1; - VERIFY( um.cbegin(0) == um.begin(0) ); - VERIFY( um.cend(0) == um.end(0) ); - const um_type::size_type bn = um.bucket(1); - VERIFY( um.cbegin(bn) != um.cend(bn) ); -} +#include int main() { - test01(); + typedef std::unordered_map test_type; + typedef typename test_type::value_type value_type; + value_type v(1, 1); + __gnu_test::forward_members_unordered test(v); return 0; } diff --git a/libstdc++-v3/testsuite/23_containers/unordered_map/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/23_containers/unordered_map/requirements/explicit_instantiation.cc deleted file mode 100644 index 9027fdcc144..00000000000 --- a/libstdc++-v3/testsuite/23_containers/unordered_map/requirements/explicit_instantiation.cc +++ /dev/null @@ -1,23 +0,0 @@ -// { dg-options "-std=gnu++0x" } -// { dg-do compile } - -// Copyright (C) 2007, 2009 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 3, or (at your option) -// any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING3. If not see -// . - -#include - -template class std::unordered_map; diff --git a/libstdc++-v3/testsuite/23_containers/unordered_map/requirements/explicit_instantiation/1.cc b/libstdc++-v3/testsuite/23_containers/unordered_map/requirements/explicit_instantiation/1.cc new file mode 100644 index 00000000000..9027fdcc144 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/unordered_map/requirements/explicit_instantiation/1.cc @@ -0,0 +1,23 @@ +// { dg-options "-std=gnu++0x" } +// { dg-do compile } + +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +#include + +template class std::unordered_map; diff --git a/libstdc++-v3/testsuite/23_containers/unordered_map/requirements/explicit_instantiation/2.cc b/libstdc++-v3/testsuite/23_containers/unordered_map/requirements/explicit_instantiation/2.cc new file mode 100644 index 00000000000..f6b5fe37274 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/unordered_map/requirements/explicit_instantiation/2.cc @@ -0,0 +1,28 @@ +// { dg-options "-std=gnu++0x" } +// { dg-do compile } + +// Copyright (C) 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +// This file tests explicit instantiation of library containers + +#include +#include +#include + +typedef __gnu_test::NonDefaultConstructible inst_type; +template class std::unordered_map; diff --git a/libstdc++-v3/testsuite/23_containers/unordered_map/requirements/explicit_instantiation/3.cc b/libstdc++-v3/testsuite/23_containers/unordered_map/requirements/explicit_instantiation/3.cc new file mode 100644 index 00000000000..695fa6f58e3 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/unordered_map/requirements/explicit_instantiation/3.cc @@ -0,0 +1,24 @@ +// { dg-options "-std=gnu++0x" } +// { dg-do compile } + +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this library; see the file COPYING3. If not see +// . + +#include + +using namespace std; +template class unordered_map, equal_to, allocator>; diff --git a/libstdc++-v3/testsuite/23_containers/unordered_map/requirements/typedefs.cc b/libstdc++-v3/testsuite/23_containers/unordered_map/requirements/typedefs.cc index 6985a9b565b..9b978cebc20 100644 --- a/libstdc++-v3/testsuite/23_containers/unordered_map/requirements/typedefs.cc +++ b/libstdc++-v3/testsuite/23_containers/unordered_map/requirements/typedefs.cc @@ -1,9 +1,7 @@ -// { dg-do compile } // { dg-options "-std=gnu++0x" } +// { dg-do compile } -// 2008-08-27 Paolo Carlini - -// Copyright (C) 2008, 2009 Free Software Foundation +// Copyright (C) 2009 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the @@ -20,27 +18,8 @@ // with this library; see the file COPYING3. If not see // . +#include #include -void test01() -{ - // Check for required typedefs - typedef std::unordered_map test_type; - - typedef test_type::key_type key_type; - typedef test_type::value_type value_type; - typedef test_type::mapped_type mapped_type; - typedef test_type::hasher hasher; - typedef test_type::key_equal key_equal; - typedef test_type::allocator_type allocator_type; - typedef test_type::pointer pointer; - typedef test_type::const_pointer const_pointer; - typedef test_type::reference reference; - typedef test_type::const_reference const_reference; - typedef test_type::size_type size_type; - typedef test_type::difference_type difference_type; - typedef test_type::iterator iterator; - typedef test_type::const_iterator const_iterator; - typedef test_type::local_iterator local_iterator; - typedef test_type::const_local_iterator const_local_iterator; -} +// Check container for required typedefs. +__gnu_test::types > t; -- cgit v1.2.1