+2011-08-29 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR libstdc++/50118
+ * include/bits/stl_list.h (_List_base<>::
+ _List_base(const allocator_type&)): Remove.
+ (_List_base<>::_List_base(const _Node_alloc_type&)): Add.
+ (list<>:list(const allocator_type&), list(size_type, const
+ value_type&, const allocator_type&),
+ list(initializer_list<, const allocator_type&),
+ list(_InputIterator, _InputIterator, const allocator_type&),
+ insert(iterator, size_type, const value_type&),
+ insert(iterator, _InputIterator, _InputIterator)): Adjust.
+ * include/bits/stl_tree.h (_Rb_tree<>::_Rb_tree(const _Compare&,
+ const allocator_type&)): Fix.
+ * include/bits/stl_map.h (map<>::map(const _Compare&,
+ const allocator_type&), map(initializer_list<>,
+ const _Compare&, const allocator_type&), map(_InputIterator,
+ _InputIterator, const _Compare&, const allocator_type&),
+ get_allocator): Adjust.
+ * include/bits/stl_set.h (set<>::set(const _Compare&,
+ const allocator_type&), set(initializer_list<>,
+ const _Compare&, const allocator_type&), set(_InputIterator,
+ _InputIterator, const _Compare&, const allocator_type&),
+ get_allocator): Likewise.
+ * include/bits/stl_multimap.h (multimap<>::multimap(const _Compare&,
+ const allocator_type&), multimap(initializer_list<>,
+ const _Compare&, const allocator_type&), multimap(_InputIterator,
+ _InputIterator, const _Compare&, const allocator_type&),
+ get_allocator): Likewise.
+ * include/bits/stl_multiset.h (multiset<>::multiset(const _Compare&,
+ const allocator_type&), multiset(initializer_list<>,
+ const _Compare&, const allocator_type&), multiset(_InputIterator,
+ _InputIterator, const _Compare&, const allocator_type&),
+ get_allocator): Likewise.
+ * include/bits/forward_list.h (_Fwd_list_base<>::
+ _Fwd_list_base(const _Alloc&), _Fwd_list_base(const _Fwd_list_base&,
+ const _Alloc&), _Fwd_list_base(_Fwd_list_base&&, const _Alloc&)):
+ Remove.
+ (_Fwd_list_base<>::_Fwd_list_base(const _Node_alloc_type&),
+ _Fwd_list_base(const _Fwd_list_base&,
+ const _Node_alloc_type&), _Fwd_list_base(_Fwd_list_base&&,
+ const _Node_alloc_type&)): Add.
+ (forward_list<>::forward_list(const _Alloc&),
+ forward_list(const forward_list&, const _Alloc&),
+ forward_list(forward_list&&, const _Alloc&),
+ forward_list(size_type, const _Tp&, const _Alloc&),
+ forward_list(_InputIterator, _InputIterator, const _Alloc&),
+ forward_list(std::initializer_list<>, const _Alloc&),
+ get_allocator): Adjust.
+ * include/bits/forward_list.tcc
+ * testsuite/util/testsuite_allocator.h (ExplicitConsAlloc): Add.
+ * testsuite/23_containers/unordered_map/requirements/
+ explicit_instantiation/5.cc: New.
+ * testsuite/23_containers/multimap/requirements/
+ explicit_instantiation/5.cc: Likewise.
+ * testsuite/23_containers/multimap/requirements/
+ explicit_instantiation/5_c++0x.cc: Likewise.
+ * testsuite/23_containers/set/requirements/explicit_instantiation/
+ 5.cc: Likewise.
+ * testsuite/23_containers/set/requirements/explicit_instantiation/
+ 5_c++0x.cc: Likewise.
+ * testsuite/23_containers/unordered_multimap/requirements/
+ explicit_instantiation/5.cc: Likewise.
+ * testsuite/23_containers/forward_list/requirements/
+ explicit_instantiation/5.cc: Likewise.
+ * testsuite/23_containers/unordered_set/requirements/
+ explicit_instantiation/5.cc: Likewise.
+ testsuite/23_containers/multiset/requirements/explicit_instantiation/
+ 5.cc: Likewise.
+ * testsuite/23_containers/multiset/requirements/
+ explicit_instantiation/5_c++0x.cc: Likewise.
+ * testsuite/23_containers/list/requirements/explicit_instantiation/
+ 5_c++0x.cc: Likewise.
+ * testsuite/23_containers/list/requirements/explicit_instantiation/
+ 5.cc: Likewise.
+ * testsuite/23_containers/unordered_multiset/requirements/
+ explicit_instantiation/5.cc: Likewise.
+ * testsuite/23_containers/map/requirements/explicit_instantiation/
+ 5.cc: Likewise.
+ * testsuite/23_containers/map/requirements/explicit_instantiation/
+ 5_c++0x.cc: Likewise.
+ * testsuite/23_containers/forward_list/requirements/dr438/
+ assign_neg.cc: Adjust dg-error line number.
+ * testsuite/23_containers/forward_list/requirements/dr438/
+ insert_neg.cc: Likewise.
+ * testsuite/23_containers/forward_list/requirements/dr438/
+ constructor_1_neg.cc: Likewise.
+ * testsuite/23_containers/forward_list/requirements/dr438/
+ constructor_2_neg.cc: Likewise.
+ * testsuite/23_containers/list/requirements/dr438/assign_neg.cc:
+ Likewise.
+ * testsuite/23_containers/list/requirements/dr438/insert_neg.cc:
+ Likewise.
+ * testsuite/23_containers/list/requirements/dr438/
+ constructor_1_neg.cc: Likewise.
+ * testsuite/23_containers/list/requirements/dr438/
+ constructor_2_neg.cc: Likewise.
+
2011-08-29 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
* acinclude.m4 (GLIBCXX_CHECK_MATH_PROTO)
_Fwd_list_base()
: _M_impl() { }
- _Fwd_list_base(const _Alloc& __a)
+ _Fwd_list_base(const _Node_alloc_type& __a)
: _M_impl(__a) { }
- _Fwd_list_base(const _Fwd_list_base& __lst, const _Alloc& __a);
+ _Fwd_list_base(const _Fwd_list_base& __lst, const _Node_alloc_type& __a);
- _Fwd_list_base(_Fwd_list_base&& __lst, const _Alloc& __a)
+ _Fwd_list_base(_Fwd_list_base&& __lst, const _Node_alloc_type& __a)
: _M_impl(__a)
{
this->_M_impl._M_head._M_next = __lst._M_impl._M_head._M_next;
typedef _Fwd_list_node<_Tp> _Node;
typedef _Fwd_list_node_base _Node_base;
typedef typename _Base::_Tp_alloc_type _Tp_alloc_type;
+ typedef typename _Base::_Node_alloc_type _Node_alloc_type;
public:
// types:
*/
explicit
forward_list(const _Alloc& __al = _Alloc())
- : _Base(__al)
+ : _Base(_Node_alloc_type(__al))
{ }
/**
* @param __al An allocator object.
*/
forward_list(const forward_list& __list, const _Alloc& __al)
- : _Base(__list, __al)
+ : _Base(__list, _Node_alloc_type(__al))
{ }
/**
* @param __al An allocator object.
*/
forward_list(forward_list&& __list, const _Alloc& __al)
- : _Base(std::move(__list), __al)
+ : _Base(std::move(__list), _Node_alloc_type(__al))
{ }
/**
*/
forward_list(size_type __n, const _Tp& __value,
const _Alloc& __al = _Alloc())
- : _Base(__al)
+ : _Base(_Node_alloc_type(__al))
{ _M_fill_initialize(__n, __value); }
/**
template<typename _InputIterator>
forward_list(_InputIterator __first, _InputIterator __last,
const _Alloc& __al = _Alloc())
- : _Base(__al)
+ : _Base(_Node_alloc_type(__al))
{
// Check whether it's an integral type. If so, it's not an iterator.
typedef typename std::__is_integer<_InputIterator>::__type _Integral;
*/
forward_list(std::initializer_list<_Tp> __il,
const _Alloc& __al = _Alloc())
- : _Base(__al)
+ : _Base(_Node_alloc_type(__al))
{ _M_initialize_dispatch(__il.begin(), __il.end(), __false_type()); }
/**
/// Get a copy of the memory allocation object.
allocator_type
get_allocator() const noexcept
- { return this->_M_get_Node_allocator(); }
+ { return allocator_type(this->_M_get_Node_allocator()); }
// 23.2.3.2 iterators:
template<typename _Tp, typename _Alloc>
_Fwd_list_base<_Tp, _Alloc>::
- _Fwd_list_base(const _Fwd_list_base& __lst, const _Alloc& __a)
+ _Fwd_list_base(const _Fwd_list_base& __lst, const _Node_alloc_type& __a)
: _M_impl(__a)
{
this->_M_impl._M_head._M_next = 0;
{
if (__n)
{
- forward_list __tmp(__n, __val, this->_M_get_Node_allocator());
+ forward_list __tmp(__n, __val, get_allocator());
return _M_splice_after(__pos, std::move(__tmp));
}
else
insert_after(const_iterator __pos,
_InputIterator __first, _InputIterator __last)
{
- forward_list __tmp(__first, __last, this->_M_get_Node_allocator());
+ forward_list __tmp(__first, __last, get_allocator());
if (!__tmp.empty())
return _M_splice_after(__pos, std::move(__tmp));
else
{
if (__il.size())
{
- forward_list __tmp(__il, this->_M_get_Node_allocator());
+ forward_list __tmp(__il, get_allocator());
return _M_splice_after(__pos, std::move(__tmp));
}
else
: _M_impl()
{ _M_init(); }
- _List_base(const allocator_type& __a)
+ _List_base(const _Node_alloc_type& __a)
: _M_impl(__a)
{ _M_init(); }
typedef _List_base<_Tp, _Alloc> _Base;
typedef typename _Base::_Tp_alloc_type _Tp_alloc_type;
+ typedef typename _Base::_Node_alloc_type _Node_alloc_type;
public:
typedef _Tp value_type;
*/
explicit
list(const allocator_type& __a)
- : _Base(__a) { }
+ : _Base(_Node_alloc_type(__a)) { }
#ifdef __GXX_EXPERIMENTAL_CXX0X__
/**
*/
list(size_type __n, const value_type& __value,
const allocator_type& __a = allocator_type())
- : _Base(__a)
+ : _Base(_Node_alloc_type(__a))
{ _M_fill_initialize(__n, __value); }
#else
/**
explicit
list(size_type __n, const value_type& __value = value_type(),
const allocator_type& __a = allocator_type())
- : _Base(__a)
+ : _Base(_Node_alloc_type(__a))
{ _M_fill_initialize(__n, __value); }
#endif
*/
list(initializer_list<value_type> __l,
const allocator_type& __a = allocator_type())
- : _Base(__a)
+ : _Base(_Node_alloc_type(__a))
{ _M_initialize_dispatch(__l.begin(), __l.end(), __false_type()); }
#endif
template<typename _InputIterator>
list(_InputIterator __first, _InputIterator __last,
const allocator_type& __a = allocator_type())
- : _Base(__a)
+ : _Base(_Node_alloc_type(__a))
{
// Check whether it's an integral type. If so, it's not an iterator.
typedef typename std::__is_integer<_InputIterator>::__type _Integral;
*/
void
insert(iterator __position, size_type __n, const value_type& __x)
- {
- list __tmp(__n, __x, _M_get_Node_allocator());
+ {
+ list __tmp(__n, __x, get_allocator());
splice(__position, __tmp);
}
insert(iterator __position, _InputIterator __first,
_InputIterator __last)
{
- list __tmp(__first, __last, _M_get_Node_allocator());
+ list __tmp(__first, __last, get_allocator());
splice(__position, __tmp);
}
explicit
map(const _Compare& __comp,
const allocator_type& __a = allocator_type())
- : _M_t(__comp, __a) { }
+ : _M_t(__comp, _Pair_alloc_type(__a)) { }
/**
* @brief %Map copy constructor.
map(initializer_list<value_type> __l,
const _Compare& __comp = _Compare(),
const allocator_type& __a = allocator_type())
- : _M_t(__comp, __a)
+ : _M_t(__comp, _Pair_alloc_type(__a))
{ _M_t._M_insert_unique(__l.begin(), __l.end()); }
#endif
map(_InputIterator __first, _InputIterator __last,
const _Compare& __comp,
const allocator_type& __a = allocator_type())
- : _M_t(__comp, __a)
+ : _M_t(__comp, _Pair_alloc_type(__a))
{ _M_t._M_insert_unique(__first, __last); }
// FIXME There is no dtor declared, but we should have something
/// Get a copy of the memory allocation object.
allocator_type
get_allocator() const _GLIBCXX_NOEXCEPT
- { return _M_t.get_allocator(); }
+ { return allocator_type(_M_t.get_allocator()); }
// iterators
/**
explicit
multimap(const _Compare& __comp,
const allocator_type& __a = allocator_type())
- : _M_t(__comp, __a) { }
+ : _M_t(__comp, _Pair_alloc_type(__a)) { }
/**
* @brief %Multimap copy constructor.
multimap(initializer_list<value_type> __l,
const _Compare& __comp = _Compare(),
const allocator_type& __a = allocator_type())
- : _M_t(__comp, __a)
+ : _M_t(__comp, _Pair_alloc_type(__a))
{ _M_t._M_insert_equal(__l.begin(), __l.end()); }
#endif
multimap(_InputIterator __first, _InputIterator __last,
const _Compare& __comp,
const allocator_type& __a = allocator_type())
- : _M_t(__comp, __a)
+ : _M_t(__comp, _Pair_alloc_type(__a))
{ _M_t._M_insert_equal(__first, __last); }
// FIXME There is no dtor declared, but we should have something generated
/// Get a copy of the memory allocation object.
allocator_type
get_allocator() const _GLIBCXX_NOEXCEPT
- { return _M_t.get_allocator(); }
+ { return allocator_type(_M_t.get_allocator()); }
// iterators
/**
explicit
multiset(const _Compare& __comp,
const allocator_type& __a = allocator_type())
- : _M_t(__comp, __a) { }
+ : _M_t(__comp, _Key_alloc_type(__a)) { }
/**
* @brief Builds a %multiset from a range.
multiset(_InputIterator __first, _InputIterator __last,
const _Compare& __comp,
const allocator_type& __a = allocator_type())
- : _M_t(__comp, __a)
+ : _M_t(__comp, _Key_alloc_type(__a))
{ _M_t._M_insert_equal(__first, __last); }
/**
multiset(initializer_list<value_type> __l,
const _Compare& __comp = _Compare(),
const allocator_type& __a = allocator_type())
- : _M_t(__comp, __a)
+ : _M_t(__comp, _Key_alloc_type(__a))
{ _M_t._M_insert_equal(__l.begin(), __l.end()); }
#endif
/// Returns the memory allocation object.
allocator_type
get_allocator() const _GLIBCXX_NOEXCEPT
- { return _M_t.get_allocator(); }
+ { return allocator_type(_M_t.get_allocator()); }
/**
* Returns a read-only (constant) iterator that points to the first
explicit
set(const _Compare& __comp,
const allocator_type& __a = allocator_type())
- : _M_t(__comp, __a) { }
+ : _M_t(__comp, _Key_alloc_type(__a)) { }
/**
* @brief Builds a %set from a range.
set(_InputIterator __first, _InputIterator __last,
const _Compare& __comp,
const allocator_type& __a = allocator_type())
- : _M_t(__comp, __a)
- { _M_t._M_insert_unique(__first, __last); }
+ : _M_t(__comp, _Key_alloc_type(__a))
+ { _M_t._M_insert_unique(__first, __last); }
/**
* @brief %Set copy constructor.
set(initializer_list<value_type> __l,
const _Compare& __comp = _Compare(),
const allocator_type& __a = allocator_type())
- : _M_t(__comp, __a)
+ : _M_t(__comp, _Key_alloc_type(__a))
{ _M_t._M_insert_unique(__l.begin(), __l.end()); }
#endif
/// Returns the allocator object with which the %set was constructed.
allocator_type
get_allocator() const _GLIBCXX_NOEXCEPT
- { return _M_t.get_allocator(); }
+ { return allocator_type(_M_t.get_allocator()); }
/**
* Returns a read-only (constant) iterator that points to the first
_Rb_tree(const _Compare& __comp,
const allocator_type& __a = allocator_type())
- : _M_impl(__comp, __a) { }
+ : _M_impl(__comp, _Node_allocator(__a)) { }
_Rb_tree(const _Rb_tree& __x)
: _M_impl(__x._M_impl._M_key_compare, __x._M_get_Node_allocator())
// { dg-do compile }
// { dg-options "-std=gnu++0x" }
-// { dg-error "no matching" "" { target *-*-* } 1210 }
+// { dg-error "no matching" "" { target *-*-* } 1211 }
-// Copyright (C) 2009, 2010 Free Software Foundation
+// Copyright (C) 2009, 2010, 2011 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
// { dg-do compile }
// { dg-options "-std=gnu++0x" }
-// { dg-error "no matching" "" { target *-*-* } 1210 }
+// { dg-error "no matching" "" { target *-*-* } 1211 }
// Copyright (C) 2009, 2010, 2011 Free Software Foundation
//
// { dg-do compile }
// { dg-options "-std=gnu++0x" }
-// { dg-error "no matching" "" { target *-*-* } 1210 }
+// { dg-error "no matching" "" { target *-*-* } 1211 }
// Copyright (C) 2009, 2010, 2011 Free Software Foundation
//
// { dg-do compile }
// { dg-options "-std=gnu++0x" }
-// { dg-error "no matching" "" { target *-*-* } 1210 }
+// { dg-error "no matching" "" { target *-*-* } 1211 }
// Copyright (C) 2009, 2010, 2011 Free Software Foundation
//
--- /dev/null
+// { dg-options "-std=gnu++0x" }
+
+// Copyright (C) 2011 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/>.
+
+// This file tests explicit instantiation of library containers
+
+#include <forward_list>
+#include <testsuite_allocator.h>
+
+// { dg-do compile }
+
+// libstdc++/50118
+template class std::forward_list<int, __gnu_test::ExplicitConsAlloc<int>>;
+template class std::forward_list<int, __gnu_test::ExplicitConsAlloc<char>>;
// <http://www.gnu.org/licenses/>.
// { dg-do compile }
-// { dg-error "no matching" "" { target *-*-* } 1498 }
+// { dg-error "no matching" "" { target *-*-* } 1499 }
#include <list>
// <http://www.gnu.org/licenses/>.
// { dg-do compile }
-// { dg-error "no matching" "" { target *-*-* } 1454 }
+// { dg-error "no matching" "" { target *-*-* } 1455 }
#include <list>
// <http://www.gnu.org/licenses/>.
// { dg-do compile }
-// { dg-error "no matching" "" { target *-*-* } 1454 }
+// { dg-error "no matching" "" { target *-*-* } 1455 }
#include <list>
#include <utility>
// <http://www.gnu.org/licenses/>.
// { dg-do compile }
-// { dg-error "no matching" "" { target *-*-* } 1454 }
+// { dg-error "no matching" "" { target *-*-* } 1455 }
#include <list>
--- /dev/null
+// Copyright (C) 2011 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/>.
+
+// This file tests explicit instantiation of library containers
+
+#include <list>
+#include <testsuite_allocator.h>
+
+// { dg-do compile }
+
+// libstdc++/50118
+template class std::list<int, __gnu_test::ExplicitConsAlloc<int> >;
+template class std::list<int, __gnu_test::ExplicitConsAlloc<char> >;
--- /dev/null
+// { dg-options "-std=gnu++0x" }
+
+// Copyright (C) 2011 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/>.
+
+// This file tests explicit instantiation of library containers
+
+#include <list>
+#include <testsuite_allocator.h>
+
+// { dg-do compile }
+
+// libstdc++/50118
+template class std::list<int, __gnu_test::ExplicitConsAlloc<int>>;
+template class std::list<int, __gnu_test::ExplicitConsAlloc<char>>;
--- /dev/null
+// Copyright (C) 2011 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/>.
+
+// This file tests explicit instantiation of library containers
+
+#include <map>
+#include <testsuite_allocator.h>
+
+// { dg-do compile }
+
+// libstdc++/50118
+template class std::map<int, int, std::less<int>,
+ __gnu_test::ExplicitConsAlloc<int> >;
+template class std::map<int, int, std::less<int>,
+ __gnu_test::ExplicitConsAlloc<char> >;
--- /dev/null
+// { dg-options "-std=gnu++0x" }
+
+// Copyright (C) 2011 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/>.
+
+// This file tests explicit instantiation of library containers
+
+#include <map>
+#include <testsuite_allocator.h>
+
+// { dg-do compile }
+
+// libstdc++/50118
+template class std::map<int, int, std::less<int>,
+ __gnu_test::ExplicitConsAlloc<int>>;
+template class std::map<int, int, std::less<int>,
+ __gnu_test::ExplicitConsAlloc<char>>;
--- /dev/null
+// Copyright (C) 2011 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/>.
+
+// This file tests explicit instantiation of library containers
+
+#include <map>
+#include <testsuite_allocator.h>
+
+// { dg-do compile }
+
+// libstdc++/50118
+template class std::multimap<int, int, std::less<int>,
+ __gnu_test::ExplicitConsAlloc<int> >;
+template class std::multimap<int, int, std::less<int>,
+ __gnu_test::ExplicitConsAlloc<char> >;
--- /dev/null
+// { dg-options "-std=gnu++0x" }
+
+// Copyright (C) 2011 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/>.
+
+// This file tests explicit instantiation of library containers
+
+#include <map>
+#include <testsuite_allocator.h>
+
+// { dg-do compile }
+
+// libstdc++/50118
+template class std::multimap<int, int, std::less<int>,
+ __gnu_test::ExplicitConsAlloc<int>>;
+template class std::multimap<int, int, std::less<int>,
+ __gnu_test::ExplicitConsAlloc<char>>;
--- /dev/null
+// Copyright (C) 2011 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/>.
+
+// This file tests explicit instantiation of library containers
+
+#include <set>
+#include <testsuite_allocator.h>
+
+// { dg-do compile }
+
+// libstdc++/50118
+template class std::multiset<int, std::less<int>,
+ __gnu_test::ExplicitConsAlloc<int> >;
+template class std::multiset<int, std::less<int>,
+ __gnu_test::ExplicitConsAlloc<char> >;
--- /dev/null
+// { dg-options "-std=gnu++0x" }
+
+// Copyright (C) 2011 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/>.
+
+// This file tests explicit instantiation of library containers
+
+#include <set>
+#include <testsuite_allocator.h>
+
+// { dg-do compile }
+
+// libstdc++/50118
+template class std::multiset<int, std::less<int>,
+ __gnu_test::ExplicitConsAlloc<int>>;
+template class std::multiset<int, std::less<int>,
+ __gnu_test::ExplicitConsAlloc<char>>;
--- /dev/null
+// Copyright (C) 2011 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/>.
+
+// This file tests explicit instantiation of library containers
+
+#include <set>
+#include <testsuite_allocator.h>
+
+// { dg-do compile }
+
+// libstdc++/50118
+template class std::set<int, std::less<int>,
+ __gnu_test::ExplicitConsAlloc<int> >;
+template class std::set<int, std::less<int>,
+ __gnu_test::ExplicitConsAlloc<char> >;
--- /dev/null
+// { dg-options "-std=gnu++0x" }
+
+// Copyright (C) 2011 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/>.
+
+// This file tests explicit instantiation of library containers
+
+#include <set>
+#include <testsuite_allocator.h>
+
+// { dg-do compile }
+
+// libstdc++/50118
+template class std::set<int, std::less<int>,
+ __gnu_test::ExplicitConsAlloc<int>>;
+template class std::set<int, std::less<int>,
+ __gnu_test::ExplicitConsAlloc<char>>;
--- /dev/null
+// { dg-options "-std=gnu++0x" }
+
+// Copyright (C) 2011 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/>.
+
+// This file tests explicit instantiation of library containers
+
+#include <unordered_map>
+#include <testsuite_allocator.h>
+
+// { dg-do compile }
+
+// libstdc++/50118
+template class std::unordered_map<int, int, std::hash<int>, std::equal_to<int>,
+ __gnu_test::ExplicitConsAlloc<int>>;
+template class std::unordered_map<int, int, std::hash<int>, std::equal_to<int>,
+ __gnu_test::ExplicitConsAlloc<char>>;
--- /dev/null
+// { dg-options "-std=gnu++0x" }
+
+// Copyright (C) 2011 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/>.
+
+// This file tests explicit instantiation of library containers
+
+#include <unordered_map>
+#include <testsuite_allocator.h>
+
+// { dg-do compile }
+
+// libstdc++/50118
+template class std::unordered_multimap<int, int, std::hash<int>,
+ std::equal_to<int>,
+ __gnu_test::ExplicitConsAlloc<int>>;
+template class std::unordered_multimap<int, int, std::hash<int>,
+ std::equal_to<int>,
+ __gnu_test::ExplicitConsAlloc<char>>;
--- /dev/null
+// { dg-options "-std=gnu++0x" }
+
+// Copyright (C) 2011 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/>.
+
+// This file tests explicit instantiation of library containers
+
+#include <unordered_set>
+#include <testsuite_allocator.h>
+
+// { dg-do compile }
+
+// libstdc++/50118
+template class std::unordered_multiset<int, std::hash<int>, std::equal_to<int>,
+ __gnu_test::ExplicitConsAlloc<int>>;
+template class std::unordered_multiset<int, std::hash<int>, std::equal_to<int>,
+ __gnu_test::ExplicitConsAlloc<char>>;
--- /dev/null
+// { dg-options "-std=gnu++0x" }
+
+// Copyright (C) 2011 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/>.
+
+// This file tests explicit instantiation of library containers
+
+#include <unordered_set>
+#include <testsuite_allocator.h>
+
+// { dg-do compile }
+
+// libstdc++/50118
+template class std::unordered_set<int, std::hash<int>, std::equal_to<int>,
+ __gnu_test::ExplicitConsAlloc<int>>;
+template class std::unordered_set<int, std::hash<int>, std::equal_to<int>,
+ __gnu_test::ExplicitConsAlloc<char>>;
#endif
+ template<typename Tp>
+ struct ExplicitConsAlloc : std::allocator<Tp>
+ {
+ ExplicitConsAlloc() { }
+
+ template<typename Up>
+ explicit
+ ExplicitConsAlloc(const ExplicitConsAlloc<Up>&) { }
+
+ template<typename Up>
+ struct rebind
+ { typedef ExplicitConsAlloc<Up> other; };
+ };
+
} // namespace __gnu_test
#endif // _GLIBCXX_TESTSUITE_ALLOCATOR_H