This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
[RFA] libstdc++/21770 (vector)
- From: Paolo Carlini <pcarlini at suse dot de>
- To: libstdc++ <libstdc++ at gcc dot gnu dot org>
- Cc: Matt Austern <austern at gmail dot com>
- Date: Sun, 29 May 2005 23:38:07 +0200
- Subject: [RFA] libstdc++/21770 (vector)
Hi,
I'm working on this PR and, before going ahead with the other
containers, I'd like to check that I'm not doing major mistakes. In
short, the problem is that of allowing allocators with value_type !=
container::value_type, a small extension of the current standard,
AFAICS, due to 23.1/8, which seem useful and other implementation
already provide.
What I'm doing is using rebinding in the base class _Vector_base, then
almost everything follows for consistency almost automatically. I'm
adding a concept check on top of vector, to remind us that, strictly
speaking, this is an extension, and a instantiation test, that, of
course, currently catastrophically fails.
In particular, I'd like to check with you that I'm not restricting
without noticing the class of allowed allocators (see recent
discussions) and that the changes are suited for v6 too: actually I'm
pretty sure about the latter, because this kind of instantiation just
completely fails, currently. Otherwise (when the value_types are equal)
everything should be provably identical.
Tested x86-linux.
Paolo.
///////////////////
diff -prN libstdc++-v3-curr/include/bits/stl_vector.h libstdc++-v3/include/bits/stl_vector.h
*** libstdc++-v3-curr/include/bits/stl_vector.h Tue May 10 03:58:18 2005
--- libstdc++-v3/include/bits/stl_vector.h Sun May 29 22:52:45 2005
*************** namespace _GLIBCXX_STD
*** 75,97 ****
template<typename _Tp, typename _Alloc>
struct _Vector_base
{
struct _Vector_impl
! : public _Alloc
{
_Tp* _M_start;
_Tp* _M_finish;
_Tp* _M_end_of_storage;
! _Vector_impl(_Alloc const& __a)
! : _Alloc(__a), _M_start(0), _M_finish(0), _M_end_of_storage(0)
{ }
};
public:
typedef _Alloc allocator_type;
allocator_type
get_allocator() const
! { return *static_cast<const _Alloc*>(&this->_M_impl); }
_Vector_base(const allocator_type& __a)
: _M_impl(__a)
--- 75,103 ----
template<typename _Tp, typename _Alloc>
struct _Vector_base
{
+ typedef typename _Alloc::template rebind<_Tp>::other _Tp_alloc_type;
+
struct _Vector_impl
! : public _Tp_alloc_type
{
_Tp* _M_start;
_Tp* _M_finish;
_Tp* _M_end_of_storage;
! _Vector_impl(_Tp_alloc_type const& __a)
! : _Tp_alloc_type(__a), _M_start(0), _M_finish(0), _M_end_of_storage(0)
{ }
};
public:
typedef _Alloc allocator_type;
+ _Tp_alloc_type
+ _M_get_Tp_allocator() const
+ { return *static_cast<const _Tp_alloc_type*>(&this->_M_impl); }
+
allocator_type
get_allocator() const
! { return _M_get_Tp_allocator(); }
_Vector_base(const allocator_type& __a)
: _M_impl(__a)
*************** namespace _GLIBCXX_STD
*** 148,164 ****
class vector : protected _Vector_base<_Tp, _Alloc>
{
// Concept requirements.
__glibcxx_class_requires(_Tp, _SGIAssignableConcept)
!
! typedef _Vector_base<_Tp, _Alloc> _Base;
! typedef vector<_Tp, _Alloc> vector_type;
public:
typedef _Tp value_type;
! typedef typename _Alloc::pointer pointer;
! typedef typename _Alloc::const_pointer const_pointer;
! typedef typename _Alloc::reference reference;
! typedef typename _Alloc::const_reference const_reference;
typedef __gnu_cxx::__normal_iterator<pointer, vector_type> iterator;
typedef __gnu_cxx::__normal_iterator<const_pointer, vector_type>
const_iterator;
--- 154,173 ----
class vector : protected _Vector_base<_Tp, _Alloc>
{
// Concept requirements.
+ typedef typename _Alloc::value_type _Alloc_value_type;
__glibcxx_class_requires(_Tp, _SGIAssignableConcept)
! __glibcxx_class_requires2(_Tp, _Alloc_value_type, _SameTypeConcept)
!
! typedef _Vector_base<_Tp, _Alloc> _Base;
! typedef vector<_Tp, _Alloc> vector_type;
! typedef typename _Base::_Tp_alloc_type _Tp_alloc_type;
public:
typedef _Tp value_type;
! typedef typename _Tp_alloc_type::pointer pointer;
! typedef typename _Tp_alloc_type::const_pointer const_pointer;
! typedef typename _Tp_alloc_type::reference reference;
! typedef typename _Tp_alloc_type::const_reference const_reference;
typedef __gnu_cxx::__normal_iterator<pointer, vector_type> iterator;
typedef __gnu_cxx::__normal_iterator<const_pointer, vector_type>
const_iterator;
*************** namespace _GLIBCXX_STD
*** 177,182 ****
--- 186,192 ----
using _Base::_M_allocate;
using _Base::_M_deallocate;
using _Base::_M_impl;
+ using _Base::_M_get_Tp_allocator;
public:
// [23.2.4.1] construct/copy/destroy
*************** namespace _GLIBCXX_STD
*** 201,207 ****
: _Base(__n, __a)
{
std::__uninitialized_fill_n_a(this->_M_impl._M_start, __n, __value,
! this->get_allocator());
this->_M_impl._M_finish = this->_M_impl._M_start + __n;
}
--- 211,217 ----
: _Base(__n, __a)
{
std::__uninitialized_fill_n_a(this->_M_impl._M_start, __n, __value,
! _M_get_Tp_allocator());
this->_M_impl._M_finish = this->_M_impl._M_start + __n;
}
*************** namespace _GLIBCXX_STD
*** 217,223 ****
: _Base(__n, allocator_type())
{
std::__uninitialized_fill_n_a(this->_M_impl._M_start, __n, value_type(),
! this->get_allocator());
this->_M_impl._M_finish = this->_M_impl._M_start + __n;
}
--- 227,233 ----
: _Base(__n, allocator_type())
{
std::__uninitialized_fill_n_a(this->_M_impl._M_start, __n, value_type(),
! _M_get_Tp_allocator());
this->_M_impl._M_finish = this->_M_impl._M_start + __n;
}
*************** namespace _GLIBCXX_STD
*** 235,241 ****
{ this->_M_impl._M_finish =
std::__uninitialized_copy_a(__x.begin(), __x.end(),
this->_M_impl._M_start,
! this->get_allocator());
}
/**
--- 245,251 ----
{ this->_M_impl._M_finish =
std::__uninitialized_copy_a(__x.begin(), __x.end(),
this->_M_impl._M_start,
! _M_get_Tp_allocator());
}
/**
*************** namespace _GLIBCXX_STD
*** 271,277 ****
*/
~vector()
{ std::_Destroy(this->_M_impl._M_start, this->_M_impl._M_finish,
! this->get_allocator());
}
/**
--- 281,287 ----
*/
~vector()
{ std::_Destroy(this->_M_impl._M_start, this->_M_impl._M_finish,
! _M_get_Tp_allocator());
}
/**
*************** namespace _GLIBCXX_STD
*** 764,770 ****
try
{
std::__uninitialized_copy_a(__first, __last, __result,
! this->get_allocator());
return __result;
}
catch(...)
--- 774,780 ----
try
{
std::__uninitialized_copy_a(__first, __last, __result,
! _M_get_Tp_allocator());
return __result;
}
catch(...)
*************** namespace _GLIBCXX_STD
*** 785,791 ****
this->_M_impl._M_start = _M_allocate(__n);
this->_M_impl._M_end_of_storage = this->_M_impl._M_start + __n;
std::__uninitialized_fill_n_a(this->_M_impl._M_start, __n, __value,
! this->get_allocator());
this->_M_impl._M_finish = this->_M_impl._M_end_of_storage;
}
--- 795,801 ----
this->_M_impl._M_start = _M_allocate(__n);
this->_M_impl._M_end_of_storage = this->_M_impl._M_start + __n;
std::__uninitialized_fill_n_a(this->_M_impl._M_start, __n, __value,
! _M_get_Tp_allocator());
this->_M_impl._M_finish = this->_M_impl._M_end_of_storage;
}
*************** namespace _GLIBCXX_STD
*** 822,828 ****
this->_M_impl._M_finish =
std::__uninitialized_copy_a(__first, __last,
this->_M_impl._M_start,
! this->get_allocator());
}
--- 832,838 ----
this->_M_impl._M_finish =
std::__uninitialized_copy_a(__first, __last,
this->_M_impl._M_start,
! _M_get_Tp_allocator());
}
diff -prN libstdc++-v3-curr/include/bits/vector.tcc libstdc++-v3/include/bits/vector.tcc
*** libstdc++-v3-curr/include/bits/vector.tcc Tue May 10 03:58:19 2005
--- libstdc++-v3/include/bits/vector.tcc Sun May 29 20:44:28 2005
*************** namespace _GLIBCXX_STD
*** 77,83 ****
this->_M_impl._M_start,
this->_M_impl._M_finish);
std::_Destroy(this->_M_impl._M_start, this->_M_impl._M_finish,
! this->get_allocator());
_M_deallocate(this->_M_impl._M_start,
this->_M_impl._M_end_of_storage
- this->_M_impl._M_start);
--- 77,83 ----
this->_M_impl._M_start,
this->_M_impl._M_finish);
std::_Destroy(this->_M_impl._M_start, this->_M_impl._M_finish,
! _M_get_Tp_allocator());
_M_deallocate(this->_M_impl._M_start,
this->_M_impl._M_end_of_storage
- this->_M_impl._M_start);
*************** namespace _GLIBCXX_STD
*** 122,128 ****
erase(iterator __first, iterator __last)
{
iterator __i(std::copy(__last, end(), __first));
! std::_Destroy(__i, end(), this->get_allocator());
this->_M_impl._M_finish = this->_M_impl._M_finish - (__last - __first);
return __first;
}
--- 122,128 ----
erase(iterator __first, iterator __last)
{
iterator __i(std::copy(__last, end(), __first));
! std::_Destroy(__i, end(), _M_get_Tp_allocator());
this->_M_impl._M_finish = this->_M_impl._M_finish - (__last - __first);
return __first;
}
*************** namespace _GLIBCXX_STD
*** 140,146 ****
pointer __tmp = _M_allocate_and_copy(__xlen, __x.begin(),
__x.end());
std::_Destroy(this->_M_impl._M_start, this->_M_impl._M_finish,
! this->get_allocator());
_M_deallocate(this->_M_impl._M_start,
this->_M_impl._M_end_of_storage
- this->_M_impl._M_start);
--- 140,146 ----
pointer __tmp = _M_allocate_and_copy(__xlen, __x.begin(),
__x.end());
std::_Destroy(this->_M_impl._M_start, this->_M_impl._M_finish,
! _M_get_Tp_allocator());
_M_deallocate(this->_M_impl._M_start,
this->_M_impl._M_end_of_storage
- this->_M_impl._M_start);
*************** namespace _GLIBCXX_STD
*** 150,156 ****
else if (size() >= __xlen)
{
iterator __i(std::copy(__x.begin(), __x.end(), begin()));
! std::_Destroy(__i, end(), this->get_allocator());
}
else
{
--- 150,156 ----
else if (size() >= __xlen)
{
iterator __i(std::copy(__x.begin(), __x.end(), begin()));
! std::_Destroy(__i, end(), _M_get_Tp_allocator());
}
else
{
*************** namespace _GLIBCXX_STD
*** 158,164 ****
this->_M_impl._M_start);
std::__uninitialized_copy_a(__x.begin() + size(),
__x.end(), this->_M_impl._M_finish,
! this->get_allocator());
}
this->_M_impl._M_finish = this->_M_impl._M_start + __xlen;
}
--- 158,164 ----
this->_M_impl._M_start);
std::__uninitialized_copy_a(__x.begin() + size(),
__x.end(), this->_M_impl._M_finish,
! _M_get_Tp_allocator());
}
this->_M_impl._M_finish = this->_M_impl._M_start + __xlen;
}
*************** namespace _GLIBCXX_STD
*** 172,178 ****
{
if (__n > capacity())
{
! vector __tmp(__n, __val, get_allocator());
__tmp.swap(*this);
}
else if (__n > size())
--- 172,178 ----
{
if (__n > capacity())
{
! vector __tmp(__n, __val, _M_get_Tp_allocator());
__tmp.swap(*this);
}
else if (__n > size())
*************** namespace _GLIBCXX_STD
*** 180,186 ****
std::fill(begin(), end(), __val);
std::__uninitialized_fill_n_a(this->_M_impl._M_finish,
__n - size(), __val,
! this->get_allocator());
this->_M_impl._M_finish += __n - size();
}
else
--- 180,186 ----
std::fill(begin(), end(), __val);
std::__uninitialized_fill_n_a(this->_M_impl._M_finish,
__n - size(), __val,
! _M_get_Tp_allocator());
this->_M_impl._M_finish += __n - size();
}
else
*************** namespace _GLIBCXX_STD
*** 216,222 ****
{
pointer __tmp(_M_allocate_and_copy(__len, __first, __last));
std::_Destroy(this->_M_impl._M_start, this->_M_impl._M_finish,
! this->get_allocator());
_M_deallocate(this->_M_impl._M_start,
this->_M_impl._M_end_of_storage
- this->_M_impl._M_start);
--- 216,222 ----
{
pointer __tmp(_M_allocate_and_copy(__len, __first, __last));
std::_Destroy(this->_M_impl._M_start, this->_M_impl._M_finish,
! _M_get_Tp_allocator());
_M_deallocate(this->_M_impl._M_start,
this->_M_impl._M_end_of_storage
- this->_M_impl._M_start);
*************** namespace _GLIBCXX_STD
*** 228,234 ****
{
iterator __new_finish(std::copy(__first, __last,
this->_M_impl._M_start));
! std::_Destroy(__new_finish, end(), this->get_allocator());
this->_M_impl._M_finish = __new_finish.base();
}
else
--- 228,234 ----
{
iterator __new_finish(std::copy(__first, __last,
this->_M_impl._M_start));
! std::_Destroy(__new_finish, end(), _M_get_Tp_allocator());
this->_M_impl._M_finish = __new_finish.base();
}
else
*************** namespace _GLIBCXX_STD
*** 239,245 ****
this->_M_impl._M_finish =
std::__uninitialized_copy_a(__mid, __last,
this->_M_impl._M_finish,
! this->get_allocator());
}
}
--- 239,245 ----
this->_M_impl._M_finish =
std::__uninitialized_copy_a(__mid, __last,
this->_M_impl._M_finish,
! _M_get_Tp_allocator());
}
}
*************** namespace _GLIBCXX_STD
*** 280,301 ****
std::__uninitialized_copy_a(iterator(this->_M_impl._M_start),
__position,
__new_start,
! this->get_allocator());
this->_M_impl.construct(__new_finish.base(), __x);
++__new_finish;
__new_finish =
std::__uninitialized_copy_a(__position,
iterator(this->_M_impl._M_finish),
__new_finish,
! this->get_allocator());
}
catch(...)
{
! std::_Destroy(__new_start, __new_finish, this->get_allocator());
_M_deallocate(__new_start.base(),__len);
__throw_exception_again;
}
! std::_Destroy(begin(), end(), this->get_allocator());
_M_deallocate(this->_M_impl._M_start,
this->_M_impl._M_end_of_storage
- this->_M_impl._M_start);
--- 280,301 ----
std::__uninitialized_copy_a(iterator(this->_M_impl._M_start),
__position,
__new_start,
! _M_get_Tp_allocator());
this->_M_impl.construct(__new_finish.base(), __x);
++__new_finish;
__new_finish =
std::__uninitialized_copy_a(__position,
iterator(this->_M_impl._M_finish),
__new_finish,
! _M_get_Tp_allocator());
}
catch(...)
{
! std::_Destroy(__new_start, __new_finish, _M_get_Tp_allocator());
_M_deallocate(__new_start.base(),__len);
__throw_exception_again;
}
! std::_Destroy(begin(), end(), _M_get_Tp_allocator());
_M_deallocate(this->_M_impl._M_start,
this->_M_impl._M_end_of_storage
- this->_M_impl._M_start);
*************** namespace _GLIBCXX_STD
*** 323,329 ****
std::__uninitialized_copy_a(this->_M_impl._M_finish - __n,
this->_M_impl._M_finish,
this->_M_impl._M_finish,
! this->get_allocator());
this->_M_impl._M_finish += __n;
std::copy_backward(__position, __old_finish - __n,
__old_finish);
--- 323,329 ----
std::__uninitialized_copy_a(this->_M_impl._M_finish - __n,
this->_M_impl._M_finish,
this->_M_impl._M_finish,
! _M_get_Tp_allocator());
this->_M_impl._M_finish += __n;
std::copy_backward(__position, __old_finish - __n,
__old_finish);
*************** namespace _GLIBCXX_STD
*** 334,344 ****
std::__uninitialized_fill_n_a(this->_M_impl._M_finish,
__n - __elems_after,
__x_copy,
! this->get_allocator());
this->_M_impl._M_finish += __n - __elems_after;
std::__uninitialized_copy_a(__position, __old_finish,
this->_M_impl._M_finish,
! this->get_allocator());
this->_M_impl._M_finish += __elems_after;
std::fill(__position, __old_finish, __x_copy);
}
--- 334,344 ----
std::__uninitialized_fill_n_a(this->_M_impl._M_finish,
__n - __elems_after,
__x_copy,
! _M_get_Tp_allocator());
this->_M_impl._M_finish += __n - __elems_after;
std::__uninitialized_copy_a(__position, __old_finish,
this->_M_impl._M_finish,
! _M_get_Tp_allocator());
this->_M_impl._M_finish += __elems_after;
std::fill(__position, __old_finish, __x_copy);
}
*************** namespace _GLIBCXX_STD
*** 361,383 ****
__new_finish =
std::__uninitialized_copy_a(begin(), __position,
__new_start,
! this->get_allocator());
std::__uninitialized_fill_n_a(__new_finish, __n, __x,
! this->get_allocator());
__new_finish += __n;
__new_finish =
std::__uninitialized_copy_a(__position, end(), __new_finish,
! this->get_allocator());
}
catch(...)
{
std::_Destroy(__new_start, __new_finish,
! this->get_allocator());
_M_deallocate(__new_start.base(), __len);
__throw_exception_again;
}
std::_Destroy(this->_M_impl._M_start, this->_M_impl._M_finish,
! this->get_allocator());
_M_deallocate(this->_M_impl._M_start,
this->_M_impl._M_end_of_storage
- this->_M_impl._M_start);
--- 361,383 ----
__new_finish =
std::__uninitialized_copy_a(begin(), __position,
__new_start,
! _M_get_Tp_allocator());
std::__uninitialized_fill_n_a(__new_finish, __n, __x,
! _M_get_Tp_allocator());
__new_finish += __n;
__new_finish =
std::__uninitialized_copy_a(__position, end(), __new_finish,
! _M_get_Tp_allocator());
}
catch(...)
{
std::_Destroy(__new_start, __new_finish,
! _M_get_Tp_allocator());
_M_deallocate(__new_start.base(), __len);
__throw_exception_again;
}
std::_Destroy(this->_M_impl._M_start, this->_M_impl._M_finish,
! _M_get_Tp_allocator());
_M_deallocate(this->_M_impl._M_start,
this->_M_impl._M_end_of_storage
- this->_M_impl._M_start);
*************** namespace _GLIBCXX_STD
*** 421,427 ****
std::__uninitialized_copy_a(this->_M_impl._M_finish - __n,
this->_M_impl._M_finish,
this->_M_impl._M_finish,
! this->get_allocator());
this->_M_impl._M_finish += __n;
std::copy_backward(__position, __old_finish - __n,
__old_finish);
--- 421,427 ----
std::__uninitialized_copy_a(this->_M_impl._M_finish - __n,
this->_M_impl._M_finish,
this->_M_impl._M_finish,
! _M_get_Tp_allocator());
this->_M_impl._M_finish += __n;
std::copy_backward(__position, __old_finish - __n,
__old_finish);
*************** namespace _GLIBCXX_STD
*** 433,443 ****
std::advance(__mid, __elems_after);
std::__uninitialized_copy_a(__mid, __last,
this->_M_impl._M_finish,
! this->get_allocator());
this->_M_impl._M_finish += __n - __elems_after;
std::__uninitialized_copy_a(__position, __old_finish,
this->_M_impl._M_finish,
! this->get_allocator());
this->_M_impl._M_finish += __elems_after;
std::copy(__first, __mid, __position);
}
--- 433,443 ----
std::advance(__mid, __elems_after);
std::__uninitialized_copy_a(__mid, __last,
this->_M_impl._M_finish,
! _M_get_Tp_allocator());
this->_M_impl._M_finish += __n - __elems_after;
std::__uninitialized_copy_a(__position, __old_finish,
this->_M_impl._M_finish,
! _M_get_Tp_allocator());
this->_M_impl._M_finish += __elems_after;
std::copy(__first, __mid, __position);
}
*************** namespace _GLIBCXX_STD
*** 461,485 ****
std::__uninitialized_copy_a(iterator(this->_M_impl._M_start),
__position,
__new_start,
! this->get_allocator());
__new_finish =
std::__uninitialized_copy_a(__first, __last, __new_finish,
! this->get_allocator());
__new_finish =
std::__uninitialized_copy_a(__position,
iterator(this->_M_impl._M_finish),
__new_finish,
! this->get_allocator());
}
catch(...)
{
std::_Destroy(__new_start,__new_finish,
! this->get_allocator());
_M_deallocate(__new_start.base(), __len);
__throw_exception_again;
}
std::_Destroy(this->_M_impl._M_start, this->_M_impl._M_finish,
! this->get_allocator());
_M_deallocate(this->_M_impl._M_start,
this->_M_impl._M_end_of_storage
- this->_M_impl._M_start);
--- 461,485 ----
std::__uninitialized_copy_a(iterator(this->_M_impl._M_start),
__position,
__new_start,
! _M_get_Tp_allocator());
__new_finish =
std::__uninitialized_copy_a(__first, __last, __new_finish,
! _M_get_Tp_allocator());
__new_finish =
std::__uninitialized_copy_a(__position,
iterator(this->_M_impl._M_finish),
__new_finish,
! _M_get_Tp_allocator());
}
catch(...)
{
std::_Destroy(__new_start,__new_finish,
! _M_get_Tp_allocator());
_M_deallocate(__new_start.base(), __len);
__throw_exception_again;
}
std::_Destroy(this->_M_impl._M_start, this->_M_impl._M_finish,
! _M_get_Tp_allocator());
_M_deallocate(this->_M_impl._M_start,
this->_M_impl._M_end_of_storage
- this->_M_impl._M_start);
diff -prN libstdc++-v3-curr/testsuite/23_containers/vector/explicit_instantiation/1.cc libstdc++-v3/testsuite/23_containers/vector/explicit_instantiation/1.cc
*** libstdc++-v3-curr/testsuite/23_containers/vector/explicit_instantiation/1.cc Thu Jan 1 01:00:00 1970
--- libstdc++-v3/testsuite/23_containers/vector/explicit_instantiation/1.cc Mon Aug 2 06:40:19 2004
***************
*** 0 ****
--- 1,34 ----
+ // Copyright (C) 2004 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 2, 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 COPYING. If not, write to the Free
+ // Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+ // USA.
+
+ // As a special exception, you may use this file as part of a free software
+ // library without restriction. Specifically, if other files instantiate
+ // templates or use macros or inline functions from this file, or you compile
+ // this file and link it with other files to produce an executable, this
+ // file does not by itself cause the resulting executable to be covered by
+ // the GNU General Public License. This exception does not however
+ // invalidate any other reasons why the executable file might be covered by
+ // the GNU General Public License.
+
+ // This file tests explicit instantiation of library containers
+
+ #include <vector>
+
+ // { dg-do compile }
+
+ template class std::vector<int>;
diff -prN libstdc++-v3-curr/testsuite/23_containers/vector/explicit_instantiation/3.cc libstdc++-v3/testsuite/23_containers/vector/explicit_instantiation/3.cc
*** libstdc++-v3-curr/testsuite/23_containers/vector/explicit_instantiation/3.cc Thu Jan 1 01:00:00 1970
--- libstdc++-v3/testsuite/23_containers/vector/explicit_instantiation/3.cc Sun May 29 22:39:37 2005
***************
*** 0 ****
--- 1,35 ----
+ // Copyright (C) 2005 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 2, 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 COPYING. If not, write to the Free
+ // Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+ // USA.
+
+ // As a special exception, you may use this file as part of a free software
+ // library without restriction. Specifically, if other files instantiate
+ // templates or use macros or inline functions from this file, or you compile
+ // this file and link it with other files to produce an executable, this
+ // file does not by itself cause the resulting executable to be covered by
+ // the GNU General Public License. This exception does not however
+ // invalidate any other reasons why the executable file might be covered by
+ // the GNU General Public License.
+
+ // This file tests explicit instantiation of library containers
+
+ #include <vector>
+
+ // { dg-do compile }
+
+ // libstdc++/21770
+ template class std::vector<int, std::allocator<char> >;
diff -prN libstdc++-v3-curr/testsuite/23_containers/vector/explicit_instantiation.cc libstdc++-v3/testsuite/23_containers/vector/explicit_instantiation.cc
*** libstdc++-v3-curr/testsuite/23_containers/vector/explicit_instantiation.cc Mon Aug 2 06:40:19 2004
--- libstdc++-v3/testsuite/23_containers/vector/explicit_instantiation.cc Thu Jan 1 01:00:00 1970
***************
*** 1,34 ****
- // Copyright (C) 2004 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 2, 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 COPYING. If not, write to the Free
- // Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
- // USA.
-
- // As a special exception, you may use this file as part of a free software
- // library without restriction. Specifically, if other files instantiate
- // templates or use macros or inline functions from this file, or you compile
- // this file and link it with other files to produce an executable, this
- // file does not by itself cause the resulting executable to be covered by
- // the GNU General Public License. This exception does not however
- // invalidate any other reasons why the executable file might be covered by
- // the GNU General Public License.
-
- // This file tests explicit instantiation of library containers
-
- #include <vector>
-
- // { dg-do compile }
-
- template class std::vector<int>;
--- 0 ----