From patchwork Mon Aug 29 13:42:08 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Carlini X-Patchwork-Id: 112053 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 17CEFB6F95 for ; Mon, 29 Aug 2011 23:42:58 +1000 (EST) Received: (qmail 15115 invoked by alias); 29 Aug 2011 13:42:56 -0000 Received: (qmail 15100 invoked by uid 22791); 29 Aug 2011 13:42:49 -0000 X-SWARE-Spam-Status: No, hits=-2.3 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from rcsinet15.oracle.com (HELO rcsinet15.oracle.com) (148.87.113.117) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 29 Aug 2011 13:42:30 +0000 Received: from rtcsinet21.oracle.com (rtcsinet21.oracle.com [66.248.204.29]) by rcsinet15.oracle.com (Switch-3.4.4/Switch-3.4.4) with ESMTP id p7TDgQTF030737 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 29 Aug 2011 13:42:29 GMT Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158]) by rtcsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id p7TDgPtS014536 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 29 Aug 2011 13:42:26 GMT Received: from abhmt119.oracle.com (abhmt119.oracle.com [141.146.116.71]) by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id p7TDgKwx016676; Mon, 29 Aug 2011 08:42:20 -0500 Received: from [192.168.1.4] (/79.43.235.115) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 29 Aug 2011 06:42:19 -0700 Message-ID: <4E5B9730.4080104@oracle.com> Date: Mon, 29 Aug 2011 15:42:08 +0200 From: Paolo Carlini User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:6.0) Gecko/20110812 Thunderbird/6.0 MIME-Version: 1.0 To: "gcc-patches@gcc.gnu.org" CC: libstdc++ Subject: [v3] Fix libstdc++/50118 X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Hi, tested x86_64-linux, committed to mainline. Thanks, Paolo. /////////////////////////// 2011-08-29 Paolo Carlini 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. Index: include/bits/stl_list.h =================================================================== --- include/bits/stl_list.h (revision 178206) +++ include/bits/stl_list.h (working copy) @@ -359,7 +359,7 @@ : _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 @@ 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 @@ */ explicit list(const allocator_type& __a) - : _Base(__a) { } + : _Base(_Node_alloc_type(__a)) { } #ifdef __GXX_EXPERIMENTAL_CXX0X__ /** @@ -550,7 +551,7 @@ */ 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 @@ 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 @@ */ list(initializer_list __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 @@ template 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 @@ */ 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 @@ 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: include/bits/stl_map.h =================================================================== --- include/bits/stl_map.h (revision 178206) +++ include/bits/stl_map.h (working copy) @@ -160,7 +160,7 @@ 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 @@ map(initializer_list __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 @@ 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 @@ /// 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: include/bits/stl_set.h =================================================================== --- include/bits/stl_set.h (revision 178206) +++ include/bits/stl_set.h (working copy) @@ -146,7 +146,7 @@ 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 @@ 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 @@ set(initializer_list __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 @@ /// 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: include/bits/forward_list.h =================================================================== --- include/bits/forward_list.h (revision 178206) +++ include/bits/forward_list.h (working copy) @@ -314,12 +314,12 @@ _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 @@ 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 @@ */ explicit forward_list(const _Alloc& __al = _Alloc()) - : _Base(__al) + : _Base(_Node_alloc_type(__al)) { } /** @@ -448,7 +449,7 @@ * @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 @@ * @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 @@ */ 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 @@ template 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 @@ */ 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 @@ /// 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: include/bits/stl_multimap.h =================================================================== --- include/bits/stl_multimap.h (revision 178206) +++ include/bits/stl_multimap.h (working copy) @@ -158,7 +158,7 @@ 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 @@ multimap(initializer_list __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 @@ 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 @@ /// 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: include/bits/stl_multiset.h =================================================================== --- include/bits/stl_multiset.h (revision 178206) +++ include/bits/stl_multiset.h (working copy) @@ -139,7 +139,7 @@ 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 @@ 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 @@ multiset(initializer_list __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 @@ /// 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: include/bits/forward_list.tcc =================================================================== --- include/bits/forward_list.tcc (revision 178206) +++ include/bits/forward_list.tcc (working copy) @@ -36,7 +36,7 @@ template _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 @@ { 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 @@ 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 @@ { 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: include/bits/stl_tree.h =================================================================== --- include/bits/stl_tree.h (revision 178206) +++ include/bits/stl_tree.h (working copy) @@ -624,7 +624,7 @@ _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: testsuite/23_containers/unordered_map/requirements/explicit_instantiation/5.cc =================================================================== --- testsuite/23_containers/unordered_map/requirements/explicit_instantiation/5.cc (revision 0) +++ testsuite/23_containers/unordered_map/requirements/explicit_instantiation/5.cc (revision 0) @@ -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 +// . + +// This file tests explicit instantiation of library containers + +#include +#include + +// { dg-do compile } + +// libstdc++/50118 +template class std::unordered_map, std::equal_to, + __gnu_test::ExplicitConsAlloc>; +template class std::unordered_map, std::equal_to, + __gnu_test::ExplicitConsAlloc>; Index: testsuite/23_containers/multimap/requirements/explicit_instantiation/5.cc =================================================================== --- testsuite/23_containers/multimap/requirements/explicit_instantiation/5.cc (revision 0) +++ testsuite/23_containers/multimap/requirements/explicit_instantiation/5.cc (revision 0) @@ -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 +// . + +// This file tests explicit instantiation of library containers + +#include +#include + +// { dg-do compile } + +// libstdc++/50118 +template class std::multimap, + __gnu_test::ExplicitConsAlloc >; +template class std::multimap, + __gnu_test::ExplicitConsAlloc >; Index: testsuite/23_containers/multimap/requirements/explicit_instantiation/5_c++0x.cc =================================================================== --- testsuite/23_containers/multimap/requirements/explicit_instantiation/5_c++0x.cc (revision 0) +++ testsuite/23_containers/multimap/requirements/explicit_instantiation/5_c++0x.cc (revision 0) @@ -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 +// . + +// This file tests explicit instantiation of library containers + +#include +#include + +// { dg-do compile } + +// libstdc++/50118 +template class std::multimap, + __gnu_test::ExplicitConsAlloc>; +template class std::multimap, + __gnu_test::ExplicitConsAlloc>; Index: testsuite/23_containers/set/requirements/explicit_instantiation/5.cc =================================================================== --- testsuite/23_containers/set/requirements/explicit_instantiation/5.cc (revision 0) +++ testsuite/23_containers/set/requirements/explicit_instantiation/5.cc (revision 0) @@ -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 +// . + +// This file tests explicit instantiation of library containers + +#include +#include + +// { dg-do compile } + +// libstdc++/50118 +template class std::set, + __gnu_test::ExplicitConsAlloc >; +template class std::set, + __gnu_test::ExplicitConsAlloc >; Index: testsuite/23_containers/set/requirements/explicit_instantiation/5_c++0x.cc =================================================================== --- testsuite/23_containers/set/requirements/explicit_instantiation/5_c++0x.cc (revision 0) +++ testsuite/23_containers/set/requirements/explicit_instantiation/5_c++0x.cc (revision 0) @@ -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 +// . + +// This file tests explicit instantiation of library containers + +#include +#include + +// { dg-do compile } + +// libstdc++/50118 +template class std::set, + __gnu_test::ExplicitConsAlloc>; +template class std::set, + __gnu_test::ExplicitConsAlloc>; Index: testsuite/23_containers/unordered_multimap/requirements/explicit_instantiation/5.cc =================================================================== --- testsuite/23_containers/unordered_multimap/requirements/explicit_instantiation/5.cc (revision 0) +++ testsuite/23_containers/unordered_multimap/requirements/explicit_instantiation/5.cc (revision 0) @@ -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 +// . + +// This file tests explicit instantiation of library containers + +#include +#include + +// { dg-do compile } + +// libstdc++/50118 +template class std::unordered_multimap, + std::equal_to, + __gnu_test::ExplicitConsAlloc>; +template class std::unordered_multimap, + std::equal_to, + __gnu_test::ExplicitConsAlloc>; Index: testsuite/23_containers/forward_list/requirements/dr438/assign_neg.cc =================================================================== --- testsuite/23_containers/forward_list/requirements/dr438/assign_neg.cc (revision 178206) +++ testsuite/23_containers/forward_list/requirements/dr438/assign_neg.cc (working copy) @@ -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: testsuite/23_containers/forward_list/requirements/dr438/insert_neg.cc =================================================================== --- testsuite/23_containers/forward_list/requirements/dr438/insert_neg.cc (revision 178206) +++ testsuite/23_containers/forward_list/requirements/dr438/insert_neg.cc (working copy) @@ -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: testsuite/23_containers/forward_list/requirements/dr438/constructor_1_neg.cc =================================================================== --- testsuite/23_containers/forward_list/requirements/dr438/constructor_1_neg.cc (revision 178206) +++ testsuite/23_containers/forward_list/requirements/dr438/constructor_1_neg.cc (working copy) @@ -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: testsuite/23_containers/forward_list/requirements/dr438/constructor_2_neg.cc =================================================================== --- testsuite/23_containers/forward_list/requirements/dr438/constructor_2_neg.cc (revision 178206) +++ testsuite/23_containers/forward_list/requirements/dr438/constructor_2_neg.cc (working copy) @@ -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: testsuite/23_containers/forward_list/requirements/explicit_instantiation/5.cc =================================================================== --- testsuite/23_containers/forward_list/requirements/explicit_instantiation/5.cc (revision 0) +++ testsuite/23_containers/forward_list/requirements/explicit_instantiation/5.cc (revision 0) @@ -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 +// . + +// This file tests explicit instantiation of library containers + +#include +#include + +// { dg-do compile } + +// libstdc++/50118 +template class std::forward_list>; +template class std::forward_list>; Index: testsuite/23_containers/unordered_set/requirements/explicit_instantiation/5.cc =================================================================== --- testsuite/23_containers/unordered_set/requirements/explicit_instantiation/5.cc (revision 0) +++ testsuite/23_containers/unordered_set/requirements/explicit_instantiation/5.cc (revision 0) @@ -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 +// . + +// This file tests explicit instantiation of library containers + +#include +#include + +// { dg-do compile } + +// libstdc++/50118 +template class std::unordered_set, std::equal_to, + __gnu_test::ExplicitConsAlloc>; +template class std::unordered_set, std::equal_to, + __gnu_test::ExplicitConsAlloc>; Index: testsuite/23_containers/multiset/requirements/explicit_instantiation/5.cc =================================================================== --- testsuite/23_containers/multiset/requirements/explicit_instantiation/5.cc (revision 0) +++ testsuite/23_containers/multiset/requirements/explicit_instantiation/5.cc (revision 0) @@ -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 +// . + +// This file tests explicit instantiation of library containers + +#include +#include + +// { dg-do compile } + +// libstdc++/50118 +template class std::multiset, + __gnu_test::ExplicitConsAlloc >; +template class std::multiset, + __gnu_test::ExplicitConsAlloc >; Index: testsuite/23_containers/multiset/requirements/explicit_instantiation/5_c++0x.cc =================================================================== --- testsuite/23_containers/multiset/requirements/explicit_instantiation/5_c++0x.cc (revision 0) +++ testsuite/23_containers/multiset/requirements/explicit_instantiation/5_c++0x.cc (revision 0) @@ -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 +// . + +// This file tests explicit instantiation of library containers + +#include +#include + +// { dg-do compile } + +// libstdc++/50118 +template class std::multiset, + __gnu_test::ExplicitConsAlloc>; +template class std::multiset, + __gnu_test::ExplicitConsAlloc>; Index: testsuite/23_containers/list/requirements/dr438/assign_neg.cc =================================================================== --- testsuite/23_containers/list/requirements/dr438/assign_neg.cc (revision 178206) +++ testsuite/23_containers/list/requirements/dr438/assign_neg.cc (working copy) @@ -18,7 +18,7 @@ // . // { dg-do compile } -// { dg-error "no matching" "" { target *-*-* } 1498 } +// { dg-error "no matching" "" { target *-*-* } 1499 } #include Index: testsuite/23_containers/list/requirements/dr438/insert_neg.cc =================================================================== --- testsuite/23_containers/list/requirements/dr438/insert_neg.cc (revision 178206) +++ testsuite/23_containers/list/requirements/dr438/insert_neg.cc (working copy) @@ -18,7 +18,7 @@ // . // { dg-do compile } -// { dg-error "no matching" "" { target *-*-* } 1454 } +// { dg-error "no matching" "" { target *-*-* } 1455 } #include Index: testsuite/23_containers/list/requirements/dr438/constructor_1_neg.cc =================================================================== --- testsuite/23_containers/list/requirements/dr438/constructor_1_neg.cc (revision 178206) +++ testsuite/23_containers/list/requirements/dr438/constructor_1_neg.cc (working copy) @@ -18,7 +18,7 @@ // . // { dg-do compile } -// { dg-error "no matching" "" { target *-*-* } 1454 } +// { dg-error "no matching" "" { target *-*-* } 1455 } #include Index: testsuite/23_containers/list/requirements/dr438/constructor_2_neg.cc =================================================================== --- testsuite/23_containers/list/requirements/dr438/constructor_2_neg.cc (revision 178206) +++ testsuite/23_containers/list/requirements/dr438/constructor_2_neg.cc (working copy) @@ -18,7 +18,7 @@ // . // { dg-do compile } -// { dg-error "no matching" "" { target *-*-* } 1454 } +// { dg-error "no matching" "" { target *-*-* } 1455 } #include #include Index: testsuite/23_containers/list/requirements/explicit_instantiation/5_c++0x.cc =================================================================== --- testsuite/23_containers/list/requirements/explicit_instantiation/5_c++0x.cc (revision 0) +++ testsuite/23_containers/list/requirements/explicit_instantiation/5_c++0x.cc (revision 0) @@ -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 +// . + +// This file tests explicit instantiation of library containers + +#include +#include + +// { dg-do compile } + +// libstdc++/50118 +template class std::list>; +template class std::list>; Index: testsuite/23_containers/list/requirements/explicit_instantiation/5.cc =================================================================== --- testsuite/23_containers/list/requirements/explicit_instantiation/5.cc (revision 0) +++ testsuite/23_containers/list/requirements/explicit_instantiation/5.cc (revision 0) @@ -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 +// . + +// This file tests explicit instantiation of library containers + +#include +#include + +// { dg-do compile } + +// libstdc++/50118 +template class std::list >; +template class std::list >; Index: testsuite/23_containers/unordered_multiset/requirements/explicit_instantiation/5.cc =================================================================== --- testsuite/23_containers/unordered_multiset/requirements/explicit_instantiation/5.cc (revision 0) +++ testsuite/23_containers/unordered_multiset/requirements/explicit_instantiation/5.cc (revision 0) @@ -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 +// . + +// This file tests explicit instantiation of library containers + +#include +#include + +// { dg-do compile } + +// libstdc++/50118 +template class std::unordered_multiset, std::equal_to, + __gnu_test::ExplicitConsAlloc>; +template class std::unordered_multiset, std::equal_to, + __gnu_test::ExplicitConsAlloc>; Index: testsuite/23_containers/map/requirements/explicit_instantiation/5.cc =================================================================== --- testsuite/23_containers/map/requirements/explicit_instantiation/5.cc (revision 0) +++ testsuite/23_containers/map/requirements/explicit_instantiation/5.cc (revision 0) @@ -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 +// . + +// This file tests explicit instantiation of library containers + +#include +#include + +// { dg-do compile } + +// libstdc++/50118 +template class std::map, + __gnu_test::ExplicitConsAlloc >; +template class std::map, + __gnu_test::ExplicitConsAlloc >; Index: testsuite/23_containers/map/requirements/explicit_instantiation/5_c++0x.cc =================================================================== --- testsuite/23_containers/map/requirements/explicit_instantiation/5_c++0x.cc (revision 0) +++ testsuite/23_containers/map/requirements/explicit_instantiation/5_c++0x.cc (revision 0) @@ -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 +// . + +// This file tests explicit instantiation of library containers + +#include +#include + +// { dg-do compile } + +// libstdc++/50118 +template class std::map, + __gnu_test::ExplicitConsAlloc>; +template class std::map, + __gnu_test::ExplicitConsAlloc>; Index: testsuite/util/testsuite_allocator.h =================================================================== --- testsuite/util/testsuite_allocator.h (revision 178206) +++ testsuite/util/testsuite_allocator.h (working copy) @@ -434,6 +434,20 @@ #endif + template + struct ExplicitConsAlloc : std::allocator + { + ExplicitConsAlloc() { } + + template + explicit + ExplicitConsAlloc(const ExplicitConsAlloc&) { } + + template + struct rebind + { typedef ExplicitConsAlloc other; }; + }; + } // namespace __gnu_test #endif // _GLIBCXX_TESTSUITE_ALLOCATOR_H