re PR libstdc++/50118 (node-based containers cannot use allocators with explicit...
authorPaolo Carlini <paolo.carlini@oracle.com>
Mon, 29 Aug 2011 13:40:33 +0000 (13:40 +0000)
committerPaolo Carlini <paolo@gcc.gnu.org>
Mon, 29 Aug 2011 13:40:33 +0000 (13:40 +0000)
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.

From-SVN: r178230

33 files changed:
libstdc++-v3/ChangeLog
libstdc++-v3/include/bits/forward_list.h
libstdc++-v3/include/bits/forward_list.tcc
libstdc++-v3/include/bits/stl_list.h
libstdc++-v3/include/bits/stl_map.h
libstdc++-v3/include/bits/stl_multimap.h
libstdc++-v3/include/bits/stl_multiset.h
libstdc++-v3/include/bits/stl_set.h
libstdc++-v3/include/bits/stl_tree.h
libstdc++-v3/testsuite/23_containers/forward_list/requirements/dr438/assign_neg.cc
libstdc++-v3/testsuite/23_containers/forward_list/requirements/dr438/constructor_1_neg.cc
libstdc++-v3/testsuite/23_containers/forward_list/requirements/dr438/constructor_2_neg.cc
libstdc++-v3/testsuite/23_containers/forward_list/requirements/dr438/insert_neg.cc
libstdc++-v3/testsuite/23_containers/forward_list/requirements/explicit_instantiation/5.cc [new file with mode: 0644]
libstdc++-v3/testsuite/23_containers/list/requirements/dr438/assign_neg.cc
libstdc++-v3/testsuite/23_containers/list/requirements/dr438/constructor_1_neg.cc
libstdc++-v3/testsuite/23_containers/list/requirements/dr438/constructor_2_neg.cc
libstdc++-v3/testsuite/23_containers/list/requirements/dr438/insert_neg.cc
libstdc++-v3/testsuite/23_containers/list/requirements/explicit_instantiation/5.cc [new file with mode: 0644]
libstdc++-v3/testsuite/23_containers/list/requirements/explicit_instantiation/5_c++0x.cc [new file with mode: 0644]
libstdc++-v3/testsuite/23_containers/map/requirements/explicit_instantiation/5.cc [new file with mode: 0644]
libstdc++-v3/testsuite/23_containers/map/requirements/explicit_instantiation/5_c++0x.cc [new file with mode: 0644]
libstdc++-v3/testsuite/23_containers/multimap/requirements/explicit_instantiation/5.cc [new file with mode: 0644]
libstdc++-v3/testsuite/23_containers/multimap/requirements/explicit_instantiation/5_c++0x.cc [new file with mode: 0644]
libstdc++-v3/testsuite/23_containers/multiset/requirements/explicit_instantiation/5.cc [new file with mode: 0644]
libstdc++-v3/testsuite/23_containers/multiset/requirements/explicit_instantiation/5_c++0x.cc [new file with mode: 0644]
libstdc++-v3/testsuite/23_containers/set/requirements/explicit_instantiation/5.cc [new file with mode: 0644]
libstdc++-v3/testsuite/23_containers/set/requirements/explicit_instantiation/5_c++0x.cc [new file with mode: 0644]
libstdc++-v3/testsuite/23_containers/unordered_map/requirements/explicit_instantiation/5.cc [new file with mode: 0644]
libstdc++-v3/testsuite/23_containers/unordered_multimap/requirements/explicit_instantiation/5.cc [new file with mode: 0644]
libstdc++-v3/testsuite/23_containers/unordered_multiset/requirements/explicit_instantiation/5.cc [new file with mode: 0644]
libstdc++-v3/testsuite/23_containers/unordered_set/requirements/explicit_instantiation/5.cc [new file with mode: 0644]
libstdc++-v3/testsuite/util/testsuite_allocator.h

index bc745b6..e6c3db0 100644 (file)
@@ -1,3 +1,101 @@
+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)
index b612424..c80ee50 100644 (file)
@@ -314,12 +314,12 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
       _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;
@@ -416,6 +416,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
       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:
@@ -439,7 +440,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
        */
       explicit
       forward_list(const _Alloc& __al = _Alloc())
-      : _Base(__al)
+      : _Base(_Node_alloc_type(__al))
       { }
 
       /**
@@ -448,7 +449,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
        *  @param  __al    An allocator object.
        */
       forward_list(const forward_list& __list, const _Alloc& __al)
-      : _Base(__list, __al)
+      : _Base(__list, _Node_alloc_type(__al))
       { }
 
       /**
@@ -457,7 +458,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
        *  @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))
       { }
 
       /**
@@ -483,7 +484,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
        */
       forward_list(size_type __n, const _Tp& __value,
                    const _Alloc& __al = _Alloc())
-      : _Base(__al)
+      : _Base(_Node_alloc_type(__al))
       { _M_fill_initialize(__n, __value); }
 
       /**
@@ -499,7 +500,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
       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;
@@ -540,7 +541,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
        */
       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()); }
 
       /**
@@ -649,7 +650,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
       /// 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:
 
index 2c319db..83f32c4 100644 (file)
@@ -36,7 +36,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
 
   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;
@@ -250,7 +250,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
     {
       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
@@ -264,7 +264,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
       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
@@ -278,7 +278,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
     {
       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
index 24a79cb..91e39f3 100644 (file)
@@ -359,7 +359,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
       : _M_impl()
       { _M_init(); }
 
-      _List_base(const allocator_type& __a)
+      _List_base(const _Node_alloc_type& __a)
       : _M_impl(__a)
       { _M_init(); }
 
@@ -441,6 +441,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
 
       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;
@@ -525,7 +526,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
        */
       explicit
       list(const allocator_type& __a)
-      : _Base(__a) { }
+      : _Base(_Node_alloc_type(__a)) { }
 
 #ifdef __GXX_EXPERIMENTAL_CXX0X__
       /**
@@ -550,7 +551,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
        */
       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
       /**
@@ -564,7 +565,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
       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
 
@@ -600,7 +601,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
        */
       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
 
@@ -617,7 +618,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
       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;
@@ -1100,8 +1101,8 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
        */
       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);
       }
 
@@ -1123,7 +1124,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
         insert(iterator __position, _InputIterator __first,
               _InputIterator __last)
         {
-         list __tmp(__first, __last, _M_get_Node_allocator());
+         list __tmp(__first, __last, get_allocator());
          splice(__position, __tmp);
        }
 
index 0501b25..889e52b 100644 (file)
@@ -160,7 +160,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
       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.
@@ -198,7 +198,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
       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
 
@@ -233,7 +233,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
         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
@@ -300,7 +300,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
       /// 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
       /**
index baa8b4e..6b74558 100644 (file)
@@ -158,7 +158,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
       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.
@@ -195,7 +195,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
       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
 
@@ -228,7 +228,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
         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
@@ -295,7 +295,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
       /// 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
       /**
index 7c307ee..8b25a97 100644 (file)
@@ -139,7 +139,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
       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.
@@ -170,7 +170,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
         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); }
 
       /**
@@ -208,7 +208,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
       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
 
@@ -278,7 +278,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
       ///  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
index 85361d6..b30966a 100644 (file)
@@ -146,7 +146,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
       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.
@@ -179,8 +179,8 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
        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.
@@ -217,7 +217,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
       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
 
@@ -286,7 +286,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
       ///  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
index 3b291c5..8c5f0c3 100644 (file)
@@ -624,7 +624,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 
       _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())
index a2be5cf..7dd46e1 100644 (file)
@@ -1,8 +1,8 @@
 // { 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
index dca3459..e8e4d57 100644 (file)
@@ -1,6 +1,6 @@
 // { 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
 //
index ec9e9c1..0ea7d2b 100644 (file)
@@ -1,6 +1,6 @@
 // { 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
 //
index 59e74eb..8d7844c 100644 (file)
@@ -1,6 +1,6 @@
 // { 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
 //
diff --git a/libstdc++-v3/testsuite/23_containers/forward_list/requirements/explicit_instantiation/5.cc b/libstdc++-v3/testsuite/23_containers/forward_list/requirements/explicit_instantiation/5.cc
new file mode 100644 (file)
index 0000000..109057c
--- /dev/null
@@ -0,0 +1,29 @@
+// { 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>>;
index 38c0c48..f53082d 100644 (file)
@@ -18,7 +18,7 @@
 // <http://www.gnu.org/licenses/>.
 
 // { dg-do compile }
-// { dg-error "no matching" "" { target *-*-* } 1498 }
+// { dg-error "no matching" "" { target *-*-* } 1499 }
 
 #include <list>
 
index 1340dc8..f0af971 100644 (file)
@@ -18,7 +18,7 @@
 // <http://www.gnu.org/licenses/>.
 
 // { dg-do compile }
-// { dg-error "no matching" "" { target *-*-* } 1454 }
+// { dg-error "no matching" "" { target *-*-* } 1455 }
 
 #include <list>
 
index 4ac6843..168d592 100644 (file)
@@ -18,7 +18,7 @@
 // <http://www.gnu.org/licenses/>.
 
 // { dg-do compile }
-// { dg-error "no matching" "" { target *-*-* } 1454 }
+// { dg-error "no matching" "" { target *-*-* } 1455 }
 
 #include <list>
 #include <utility>
index 1fa2ed6..32bfd53 100644 (file)
@@ -18,7 +18,7 @@
 // <http://www.gnu.org/licenses/>.
 
 // { dg-do compile }
-// { dg-error "no matching" "" { target *-*-* } 1454 }
+// { dg-error "no matching" "" { target *-*-* } 1455 }
 
 #include <list>
 
diff --git a/libstdc++-v3/testsuite/23_containers/list/requirements/explicit_instantiation/5.cc b/libstdc++-v3/testsuite/23_containers/list/requirements/explicit_instantiation/5.cc
new file mode 100644 (file)
index 0000000..965eb9e
--- /dev/null
@@ -0,0 +1,27 @@
+// 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> >;
diff --git a/libstdc++-v3/testsuite/23_containers/list/requirements/explicit_instantiation/5_c++0x.cc b/libstdc++-v3/testsuite/23_containers/list/requirements/explicit_instantiation/5_c++0x.cc
new file mode 100644 (file)
index 0000000..83f207c
--- /dev/null
@@ -0,0 +1,29 @@
+// { 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>>;
diff --git a/libstdc++-v3/testsuite/23_containers/map/requirements/explicit_instantiation/5.cc b/libstdc++-v3/testsuite/23_containers/map/requirements/explicit_instantiation/5.cc
new file mode 100644 (file)
index 0000000..b4fbfff
--- /dev/null
@@ -0,0 +1,29 @@
+// 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> >;
diff --git a/libstdc++-v3/testsuite/23_containers/map/requirements/explicit_instantiation/5_c++0x.cc b/libstdc++-v3/testsuite/23_containers/map/requirements/explicit_instantiation/5_c++0x.cc
new file mode 100644 (file)
index 0000000..3f9a7f8
--- /dev/null
@@ -0,0 +1,31 @@
+// { 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>>;
diff --git a/libstdc++-v3/testsuite/23_containers/multimap/requirements/explicit_instantiation/5.cc b/libstdc++-v3/testsuite/23_containers/multimap/requirements/explicit_instantiation/5.cc
new file mode 100644 (file)
index 0000000..1d49e58
--- /dev/null
@@ -0,0 +1,29 @@
+// 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> >;
diff --git a/libstdc++-v3/testsuite/23_containers/multimap/requirements/explicit_instantiation/5_c++0x.cc b/libstdc++-v3/testsuite/23_containers/multimap/requirements/explicit_instantiation/5_c++0x.cc
new file mode 100644 (file)
index 0000000..195f83b
--- /dev/null
@@ -0,0 +1,31 @@
+// { 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>>;
diff --git a/libstdc++-v3/testsuite/23_containers/multiset/requirements/explicit_instantiation/5.cc b/libstdc++-v3/testsuite/23_containers/multiset/requirements/explicit_instantiation/5.cc
new file mode 100644 (file)
index 0000000..2cb307d
--- /dev/null
@@ -0,0 +1,29 @@
+// 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> >;
diff --git a/libstdc++-v3/testsuite/23_containers/multiset/requirements/explicit_instantiation/5_c++0x.cc b/libstdc++-v3/testsuite/23_containers/multiset/requirements/explicit_instantiation/5_c++0x.cc
new file mode 100644 (file)
index 0000000..2eea2c9
--- /dev/null
@@ -0,0 +1,31 @@
+// { 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>>;
diff --git a/libstdc++-v3/testsuite/23_containers/set/requirements/explicit_instantiation/5.cc b/libstdc++-v3/testsuite/23_containers/set/requirements/explicit_instantiation/5.cc
new file mode 100644 (file)
index 0000000..32cd695
--- /dev/null
@@ -0,0 +1,29 @@
+// 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> >;
diff --git a/libstdc++-v3/testsuite/23_containers/set/requirements/explicit_instantiation/5_c++0x.cc b/libstdc++-v3/testsuite/23_containers/set/requirements/explicit_instantiation/5_c++0x.cc
new file mode 100644 (file)
index 0000000..2e44282
--- /dev/null
@@ -0,0 +1,31 @@
+// { 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>>;
diff --git a/libstdc++-v3/testsuite/23_containers/unordered_map/requirements/explicit_instantiation/5.cc b/libstdc++-v3/testsuite/23_containers/unordered_map/requirements/explicit_instantiation/5.cc
new file mode 100644 (file)
index 0000000..f2bd46d
--- /dev/null
@@ -0,0 +1,31 @@
+// { 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>>;
diff --git a/libstdc++-v3/testsuite/23_containers/unordered_multimap/requirements/explicit_instantiation/5.cc b/libstdc++-v3/testsuite/23_containers/unordered_multimap/requirements/explicit_instantiation/5.cc
new file mode 100644 (file)
index 0000000..b8574b1
--- /dev/null
@@ -0,0 +1,33 @@
+// { 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>>;
diff --git a/libstdc++-v3/testsuite/23_containers/unordered_multiset/requirements/explicit_instantiation/5.cc b/libstdc++-v3/testsuite/23_containers/unordered_multiset/requirements/explicit_instantiation/5.cc
new file mode 100644 (file)
index 0000000..20c6e96
--- /dev/null
@@ -0,0 +1,31 @@
+// { 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>>;
diff --git a/libstdc++-v3/testsuite/23_containers/unordered_set/requirements/explicit_instantiation/5.cc b/libstdc++-v3/testsuite/23_containers/unordered_set/requirements/explicit_instantiation/5.cc
new file mode 100644 (file)
index 0000000..53ce070
--- /dev/null
@@ -0,0 +1,31 @@
+// { 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>>;
index 5ef5cdb..279c42d 100644 (file)
@@ -434,6 +434,20 @@ namespace __gnu_test
 
 #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