diff options
Diffstat (limited to 'libstdc++-v3/testsuite/tr1/6_containers/unordered_multimap/requirements')
4 files changed, 156 insertions, 0 deletions
diff --git a/libstdc++-v3/testsuite/tr1/6_containers/unordered_multimap/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/tr1/6_containers/unordered_multimap/requirements/explicit_instantiation.cc new file mode 100644 index 000000000..0eec033ce --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/6_containers/unordered_multimap/requirements/explicit_instantiation.cc @@ -0,0 +1,42 @@ +// { dg-do compile } + +// 2005-02-17 Matt Austern <austern@apple.com> +// +// Copyright (C) 2005, 2006, 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 +// <http://www.gnu.org/licenses/>. + +// 6.3.4.6 unordered_multimap + +#include <string> +#include <tr1/unordered_map> + +using namespace std::tr1; +using std::string; +using std::equal_to; +using std::allocator; +using std::pair; + +template class unordered_multimap<string, float>; +template class unordered_multimap<string, int, + hash<string>, equal_to<string>, + allocator<pair<const string, int> > >; +template class unordered_multimap<string, float, + hash<string>, equal_to<string>, + allocator<char> >; +template class __unordered_multimap<string, int, + hash<string>, equal_to<string>, + allocator<pair<const string, int> >, true>; diff --git a/libstdc++-v3/testsuite/tr1/6_containers/unordered_multimap/requirements/iterator_neg.cc b/libstdc++-v3/testsuite/tr1/6_containers/unordered_multimap/requirements/iterator_neg.cc new file mode 100644 index 000000000..fb0db99cf --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/6_containers/unordered_multimap/requirements/iterator_neg.cc @@ -0,0 +1,40 @@ +// 2005-10-02 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2005, 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 +// <http://www.gnu.org/licenses/>. +// + +// { dg-do compile } + +#include <tr1/unordered_map> + +void test01() +{ + typedef std::tr1::unordered_multimap<int, int> Mmap; + + Mmap mm; + + Mmap::const_iterator cit = mm.begin(); + (*cit).second = 0; // { dg-error "read-only" } + + Mmap::const_local_iterator clit = mm.begin(0); + (*clit).second = 0; // { dg-error "read-only" } + + Mmap::iterator it = cit; // { dg-error "conversion" } + + Mmap::local_iterator lit = clit; // { dg-error "conversion" } +} diff --git a/libstdc++-v3/testsuite/tr1/6_containers/unordered_multimap/requirements/iterator_null_neg.cc b/libstdc++-v3/testsuite/tr1/6_containers/unordered_multimap/requirements/iterator_null_neg.cc new file mode 100644 index 000000000..1709816c3 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/6_containers/unordered_multimap/requirements/iterator_null_neg.cc @@ -0,0 +1,28 @@ +// 2005-09-10 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2005, 2009, 2010 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 +// <http://www.gnu.org/licenses/>. +// + +// { dg-do compile } + +// libstdc++/23781 +#include <tr1/unordered_map> +#include <cstddef> + +std::tr1::unordered_multimap<int, int>::iterator it2 = NULL; // { dg-error "conversion" } +std::tr1::unordered_multimap<int, int>::const_iterator cit2 = NULL; // { dg-error "conversion" } diff --git a/libstdc++-v3/testsuite/tr1/6_containers/unordered_multimap/requirements/typedefs.cc b/libstdc++-v3/testsuite/tr1/6_containers/unordered_multimap/requirements/typedefs.cc new file mode 100644 index 000000000..54ae610e6 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/6_containers/unordered_multimap/requirements/typedefs.cc @@ -0,0 +1,46 @@ +// { dg-do compile } +// 2008-08-27 Paolo Carlini <paolo.carlini@oracle.com> + +// Copyright (C) 2008, 2009 Free Software Foundation +// +// 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 +// <http://www.gnu.org/licenses/>. + +// 6.3.4.6 unordered_multimap + +#include <tr1/unordered_map> + +void test01() +{ + // Check for required typedefs + typedef std::tr1::unordered_multimap<int, int> 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; +} |