Remove array_allocator extension, deprecated since 4.9.0
This type is not a conforming allocator, because it cannot be reliably rebound to allocate for a different type. The result of the rebind transformation still uses the same underlying std::tr1::array<T, 1> array, which may not be correctly aligned or even have elements the right size for the value_type of the rebound allocator. It has been deprecated for several years and should now be removed. * doc/xml/manual/allocator.xml: Remove documentation for array_allocator. * doc/xml/manual/evolution.xml: Document array_allocator removal. * doc/xml/manual/using.xml: Remove header from documentation. * include/Makefile.am: Remove <ext/array_allocator.h> header. * include/Makefile.in: Regenerate. * include/ext/array_allocator.h: Remove. * include/precompiled/extc++.h: Do not include removed header. * testsuite/ext/array_allocator/1.cc: Remove. * testsuite/ext/array_allocator/2.cc: Remove. * testsuite/ext/array_allocator/26875.cc: Remove. * testsuite/ext/array_allocator/3.cc: Remove. * testsuite/ext/array_allocator/check_deallocate_null.cc: Remove. * testsuite/ext/array_allocator/check_delete.cc: Remove. * testsuite/ext/array_allocator/check_new.cc: Remove. * testsuite/ext/array_allocator/variadic_construct.cc: Remove. * testsuite/ext/headers.cc: Do not include removed header. From-SVN: r271119
This commit is contained in:
parent
6db881be90
commit
0d09ca2550
18 changed files with 25 additions and 617 deletions
|
@ -1,3 +1,24 @@
|
|||
2019-05-11 Jonathan Wakely <jwakely@redhat.com>
|
||||
|
||||
Remove array_allocator extension, deprecated since 4.9.0
|
||||
* doc/xml/manual/allocator.xml: Remove documentation for
|
||||
array_allocator.
|
||||
* doc/xml/manual/evolution.xml: Document array_allocator removal.
|
||||
* doc/xml/manual/using.xml: Remove header from documentation.
|
||||
* include/Makefile.am: Remove <ext/array_allocator.h> header.
|
||||
* include/Makefile.in: Regenerate.
|
||||
* include/ext/array_allocator.h: Remove.
|
||||
* include/precompiled/extc++.h: Do not include removed header.
|
||||
* testsuite/ext/array_allocator/1.cc: Remove.
|
||||
* testsuite/ext/array_allocator/2.cc: Remove.
|
||||
* testsuite/ext/array_allocator/26875.cc: Remove.
|
||||
* testsuite/ext/array_allocator/3.cc: Remove.
|
||||
* testsuite/ext/array_allocator/check_deallocate_null.cc: Remove.
|
||||
* testsuite/ext/array_allocator/check_delete.cc: Remove.
|
||||
* testsuite/ext/array_allocator/check_new.cc: Remove.
|
||||
* testsuite/ext/array_allocator/variadic_construct.cc: Remove.
|
||||
* testsuite/ext/headers.cc: Do not include removed header.
|
||||
|
||||
2019-05-11 François Dumont <fdumont@gcc.gnu.org>
|
||||
|
||||
* include/bits/stl_bvector.h
|
||||
|
|
|
@ -354,23 +354,6 @@
|
|||
taken care of elsewhere).
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<classname>array_allocator</classname>
|
||||
</para>
|
||||
<para>
|
||||
Allows allocations of known and fixed sizes using existing
|
||||
global or external storage allocated via construction of
|
||||
<classname>std::tr1::array</classname> objects. By using this
|
||||
allocator, fixed size containers (including
|
||||
<classname>std::string</classname>) can be used without
|
||||
instances calling <function>::operator new</function> and
|
||||
<function>::operator delete</function>. This capability
|
||||
allows the use of STL abstractions without runtime
|
||||
complications or overhead, even in situations such as program
|
||||
startup. For usage examples, please consult the testsuite.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<classname>debug_allocator</classname>
|
||||
|
|
|
@ -947,4 +947,8 @@ now defaults to zero.
|
|||
|
||||
</section>
|
||||
|
||||
<section xml:id="api.rel_101"><info><title><constant>10</constant></title></info>
|
||||
<para> <classname>__gnu_cxx::array_allocator</classname> removed. </para>
|
||||
</section>
|
||||
|
||||
</section>
|
||||
|
|
|
@ -719,7 +719,6 @@ compiler supports scalar decimal floating-point types defined via
|
|||
<row>
|
||||
<entry><filename class="headerfile">ext/algorithm</filename></entry>
|
||||
<entry><filename class="headerfile">ext/atomicity.h</filename></entry>
|
||||
<entry><filename class="headerfile">ext/array_allocator.h</filename></entry>
|
||||
<entry><filename class="headerfile">ext/bitmap_allocator.h</filename></entry>
|
||||
<entry><filename class="headerfile">ext/cast.h</filename></entry>
|
||||
</row>
|
||||
|
|
|
@ -563,7 +563,6 @@ ext_headers = \
|
|||
${ext_srcdir}/aligned_buffer.h \
|
||||
${ext_srcdir}/alloc_traits.h \
|
||||
${ext_srcdir}/atomicity.h \
|
||||
${ext_srcdir}/array_allocator.h \
|
||||
${ext_srcdir}/bitmap_allocator.h \
|
||||
${ext_srcdir}/cast.h \
|
||||
${ext_srcdir}/cmath \
|
||||
|
|
|
@ -906,7 +906,6 @@ ext_headers = \
|
|||
${ext_srcdir}/aligned_buffer.h \
|
||||
${ext_srcdir}/alloc_traits.h \
|
||||
${ext_srcdir}/atomicity.h \
|
||||
${ext_srcdir}/array_allocator.h \
|
||||
${ext_srcdir}/bitmap_allocator.h \
|
||||
${ext_srcdir}/cast.h \
|
||||
${ext_srcdir}/cmath \
|
||||
|
|
|
@ -1,182 +0,0 @@
|
|||
// array allocator -*- C++ -*-
|
||||
|
||||
// Copyright (C) 2004-2019 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.
|
||||
|
||||
// Under Section 7 of GPL version 3, you are granted additional
|
||||
// permissions described in the GCC Runtime Library Exception, version
|
||||
// 3.1, as published by the Free Software Foundation.
|
||||
|
||||
// You should have received a copy of the GNU General Public License and
|
||||
// a copy of the GCC Runtime Library Exception along with this program;
|
||||
// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
||||
// <http://www.gnu.org/licenses/>.
|
||||
|
||||
/** @file ext/array_allocator.h
|
||||
* This file is a GNU extension to the Standard C++ Library.
|
||||
*/
|
||||
|
||||
#ifndef _ARRAY_ALLOCATOR_H
|
||||
#define _ARRAY_ALLOCATOR_H 1
|
||||
|
||||
#include <bits/c++config.h>
|
||||
#include <new>
|
||||
#include <bits/functexcept.h>
|
||||
#include <tr1/array>
|
||||
#include <bits/move.h>
|
||||
#if __cplusplus >= 201103L
|
||||
#include <type_traits>
|
||||
#endif
|
||||
|
||||
// Suppress deprecated warning for this file.
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
|
||||
|
||||
namespace __gnu_cxx _GLIBCXX_VISIBILITY(default)
|
||||
{
|
||||
_GLIBCXX_BEGIN_NAMESPACE_VERSION
|
||||
|
||||
using std::size_t;
|
||||
using std::ptrdiff_t;
|
||||
|
||||
/// Base class.
|
||||
template<typename _Tp>
|
||||
class array_allocator_base
|
||||
{
|
||||
public:
|
||||
typedef size_t size_type;
|
||||
typedef ptrdiff_t difference_type;
|
||||
typedef _Tp* pointer;
|
||||
typedef const _Tp* const_pointer;
|
||||
typedef _Tp& reference;
|
||||
typedef const _Tp& const_reference;
|
||||
typedef _Tp value_type;
|
||||
|
||||
pointer
|
||||
address(reference __x) const _GLIBCXX_NOEXCEPT
|
||||
{ return std::__addressof(__x); }
|
||||
|
||||
const_pointer
|
||||
address(const_reference __x) const _GLIBCXX_NOEXCEPT
|
||||
{ return std::__addressof(__x); }
|
||||
|
||||
void
|
||||
deallocate(pointer, size_type)
|
||||
{
|
||||
// Does nothing.
|
||||
}
|
||||
|
||||
size_type
|
||||
max_size() const _GLIBCXX_USE_NOEXCEPT
|
||||
{ return size_t(-1) / sizeof(_Tp); }
|
||||
|
||||
#if __cplusplus >= 201103L
|
||||
template<typename _Up, typename... _Args>
|
||||
void
|
||||
construct(_Up* __p, _Args&&... __args)
|
||||
{ ::new((void *)__p) _Up(std::forward<_Args>(__args)...); }
|
||||
|
||||
template<typename _Up>
|
||||
void
|
||||
destroy(_Up* __p) { __p->~_Up(); }
|
||||
#else
|
||||
// _GLIBCXX_RESOLVE_LIB_DEFECTS
|
||||
// 402. wrong new expression in [some_] allocator::construct
|
||||
void
|
||||
construct(pointer __p, const _Tp& __val)
|
||||
{ ::new((void *)__p) value_type(__val); }
|
||||
|
||||
void
|
||||
destroy(pointer __p) { __p->~_Tp(); }
|
||||
#endif
|
||||
} _GLIBCXX_DEPRECATED;
|
||||
|
||||
/**
|
||||
* @brief An allocator that uses previously allocated memory.
|
||||
* This memory can be externally, globally, or otherwise allocated.
|
||||
* @ingroup allocators
|
||||
*/
|
||||
template<typename _Tp, typename _Array = std::tr1::array<_Tp, 1> >
|
||||
class array_allocator : public array_allocator_base<_Tp>
|
||||
{
|
||||
public:
|
||||
typedef size_t size_type;
|
||||
typedef ptrdiff_t difference_type;
|
||||
typedef _Tp* pointer;
|
||||
typedef const _Tp* const_pointer;
|
||||
typedef _Tp& reference;
|
||||
typedef const _Tp& const_reference;
|
||||
typedef _Tp value_type;
|
||||
typedef _Array array_type;
|
||||
|
||||
#if __cplusplus >= 201103L
|
||||
// _GLIBCXX_RESOLVE_LIB_DEFECTS
|
||||
// 2103. std::allocator propagate_on_container_move_assignment
|
||||
typedef std::true_type propagate_on_container_move_assignment;
|
||||
|
||||
typedef std::true_type is_always_equal;
|
||||
#endif
|
||||
|
||||
private:
|
||||
array_type* _M_array;
|
||||
size_type _M_used;
|
||||
|
||||
public:
|
||||
template<typename _Tp1, typename _Array1 = _Array>
|
||||
struct rebind
|
||||
{
|
||||
typedef array_allocator<_Tp1, _Array1> other _GLIBCXX_DEPRECATED;
|
||||
} _GLIBCXX_DEPRECATED;
|
||||
|
||||
array_allocator(array_type* __array = 0) _GLIBCXX_USE_NOEXCEPT
|
||||
: _M_array(__array), _M_used(size_type()) { }
|
||||
|
||||
array_allocator(const array_allocator& __o) _GLIBCXX_USE_NOEXCEPT
|
||||
: _M_array(__o._M_array), _M_used(__o._M_used) { }
|
||||
|
||||
template<typename _Tp1, typename _Array1>
|
||||
array_allocator(const array_allocator<_Tp1, _Array1>&)
|
||||
_GLIBCXX_USE_NOEXCEPT
|
||||
: _M_array(0), _M_used(size_type()) { }
|
||||
|
||||
~array_allocator() _GLIBCXX_USE_NOEXCEPT { }
|
||||
|
||||
_GLIBCXX_NODISCARD pointer
|
||||
allocate(size_type __n, const void* = 0)
|
||||
{
|
||||
if (_M_array == 0 || _M_used + __n > _M_array->size())
|
||||
std::__throw_bad_alloc();
|
||||
pointer __ret = _M_array->begin() + _M_used;
|
||||
_M_used += __n;
|
||||
return __ret;
|
||||
}
|
||||
} _GLIBCXX_DEPRECATED;
|
||||
|
||||
template<typename _Tp, typename _Array>
|
||||
inline bool
|
||||
operator==(const array_allocator<_Tp, _Array>&,
|
||||
const array_allocator<_Tp, _Array>&)
|
||||
{ return true; }
|
||||
|
||||
template<typename _Tp, typename _Array>
|
||||
inline bool
|
||||
operator!=(const array_allocator<_Tp, _Array>&,
|
||||
const array_allocator<_Tp, _Array>&)
|
||||
{ return false; }
|
||||
|
||||
_GLIBCXX_END_NAMESPACE_VERSION
|
||||
} // namespace
|
||||
|
||||
#pragma GCC diagnostic pop
|
||||
|
||||
#endif
|
|
@ -37,7 +37,6 @@
|
|||
# include <ext/aligned_buffer.h>
|
||||
#endif
|
||||
#include <ext/alloc_traits.h>
|
||||
#include <ext/array_allocator.h>
|
||||
#include <ext/atomicity.h>
|
||||
#include <ext/bitmap_allocator.h>
|
||||
#include <ext/cast.h>
|
||||
|
|
|
@ -1,57 +0,0 @@
|
|||
// Copyright (C) 2004-2019 Free Software Foundation, Inc.
|
||||
//
|
||||
// This file is part of the GNU ISO C++ Library. This library is free
|
||||
// software; you can redistribute it and/or modify it under the
|
||||
// terms of the GNU General Public License as published by the
|
||||
// Free Software Foundation; either version 3, or (at your option)
|
||||
// any later version.
|
||||
|
||||
// This library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License along
|
||||
// with this library; see the file COPYING3. If not see
|
||||
// <http://www.gnu.org/licenses/>.
|
||||
|
||||
// { dg-options "-Wno-deprecated" }
|
||||
|
||||
#include <ext/vstring.h>
|
||||
#include <ext/array_allocator.h>
|
||||
#include <testsuite_hooks.h>
|
||||
|
||||
typedef char char_type;
|
||||
typedef std::char_traits<char_type> traits_type;
|
||||
typedef std::tr1::array<char_type, 4> array_type;
|
||||
|
||||
array_type extern_array;
|
||||
|
||||
void test01()
|
||||
{
|
||||
using __gnu_cxx::__versa_string;
|
||||
typedef __gnu_cxx::array_allocator<char_type, array_type> allocator_type;
|
||||
typedef __versa_string<char_type, traits_type, allocator_type> string_type;
|
||||
|
||||
allocator_type a(&extern_array);
|
||||
string_type s(a);
|
||||
|
||||
try
|
||||
{
|
||||
s.reserve(4); // Actually need 4 + 1 + sizeof(std::string::_Rep).
|
||||
}
|
||||
catch(std::bad_alloc& obj)
|
||||
{
|
||||
VERIFY( true );
|
||||
}
|
||||
catch(...)
|
||||
{
|
||||
VERIFY( false );
|
||||
}
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
test01();
|
||||
return 0;
|
||||
}
|
|
@ -1,63 +0,0 @@
|
|||
// Copyright (C) 2004-2019 Free Software Foundation, Inc.
|
||||
//
|
||||
// This file is part of the GNU ISO C++ Library. This library is free
|
||||
// software; you can redistribute it and/or modify it under the
|
||||
// terms of the GNU General Public License as published by the
|
||||
// Free Software Foundation; either version 3, or (at your option)
|
||||
// any later version.
|
||||
|
||||
// This library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License along
|
||||
// with this library; see the file COPYING3. If not see
|
||||
// <http://www.gnu.org/licenses/>.
|
||||
|
||||
// { dg-options "-Wno-deprecated" }
|
||||
|
||||
#include <iostream>
|
||||
#include <ext/vstring.h>
|
||||
#include <ext/array_allocator.h>
|
||||
#include <testsuite_hooks.h>
|
||||
|
||||
typedef char char_type;
|
||||
typedef std::char_traits<char_type> traits_type;
|
||||
typedef std::tr1::array<char_type, 32> array_type;
|
||||
|
||||
array_type extern_array;
|
||||
|
||||
void test01()
|
||||
{
|
||||
using __gnu_cxx::__versa_string;
|
||||
typedef __gnu_cxx::array_allocator<char_type, array_type> allocator_type;
|
||||
typedef __versa_string<char_type, traits_type, allocator_type> string_type;
|
||||
|
||||
allocator_type a(&extern_array);
|
||||
string_type s(a);
|
||||
|
||||
try
|
||||
{
|
||||
s.reserve(4); // Actually need 4 + 1 + sizeof(std::string::_Rep).
|
||||
}
|
||||
catch(std::bad_alloc& obj)
|
||||
{
|
||||
VERIFY( false );
|
||||
}
|
||||
catch(...)
|
||||
{
|
||||
VERIFY( false );
|
||||
}
|
||||
|
||||
s.append(1, 'c');
|
||||
s.append(2, 'b');
|
||||
|
||||
std::cout << s.c_str() << std::endl;
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
test01();
|
||||
return 0;
|
||||
}
|
|
@ -1,47 +0,0 @@
|
|||
//
|
||||
// Copyright (C) 2006-2019 Free Software Foundation, Inc.
|
||||
//
|
||||
// This file is part of the GNU ISO C++ Library. This library is free
|
||||
// software; you can redistribute it and/or modify it under the
|
||||
// terms of the GNU General Public License as published by the
|
||||
// Free Software Foundation; either version 3, or (at your option)
|
||||
// any later version.
|
||||
//
|
||||
// This library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License along
|
||||
// with this library; see the file COPYING3. If not see
|
||||
// <http://www.gnu.org/licenses/>.
|
||||
|
||||
// { dg-options "-Wno-deprecated" }
|
||||
|
||||
#include <ext/array_allocator.h>
|
||||
|
||||
// libstdc++/26875
|
||||
int main()
|
||||
{
|
||||
typedef std::tr1::array<int, 1> array_type;
|
||||
array_type Array1;
|
||||
array_type Array2;
|
||||
|
||||
typedef __gnu_cxx::array_allocator<int> allocator_type;
|
||||
allocator_type Allocator1(&Array1);
|
||||
allocator_type Allocator2(&Array2);
|
||||
|
||||
try
|
||||
{
|
||||
(void) Allocator1.allocate(1);
|
||||
(void) Allocator2.allocate(1);
|
||||
}
|
||||
catch (std::bad_alloc& ex)
|
||||
{
|
||||
// fail, rethrow
|
||||
throw;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -1,58 +0,0 @@
|
|||
// Copyright (C) 2004-2019 Free Software Foundation, Inc.
|
||||
//
|
||||
// This file is part of the GNU ISO C++ Library. This library is free
|
||||
// software; you can redistribute it and/or modify it under the
|
||||
// terms of the GNU General Public License as published by the
|
||||
// Free Software Foundation; either version 3, or (at your option)
|
||||
// any later version.
|
||||
|
||||
// This library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License along
|
||||
// with this library; see the file COPYING3. If not see
|
||||
// <http://www.gnu.org/licenses/>.
|
||||
|
||||
// { dg-options "-Wno-deprecated" }
|
||||
|
||||
#include <ext/vstring.h>
|
||||
#include <ext/array_allocator.h>
|
||||
#include <testsuite_hooks.h>
|
||||
|
||||
typedef char char_type;
|
||||
typedef std::char_traits<char_type> traits_type;
|
||||
typedef std::tr1::array<char_type, 4> array_type;
|
||||
|
||||
array_type extern_array;
|
||||
|
||||
void test01()
|
||||
{
|
||||
using __gnu_cxx::__versa_string;
|
||||
typedef __gnu_cxx::array_allocator<char_type, array_type> allocator_type;
|
||||
typedef __versa_string<char_type, traits_type, allocator_type> string_type;
|
||||
|
||||
// Construct array_allocator without underlying array.
|
||||
allocator_type a;
|
||||
string_type s(a);
|
||||
|
||||
try
|
||||
{
|
||||
s.reserve(4); // Actually need 4 + 1 + sizeof(std::string::_Rep).
|
||||
}
|
||||
catch(std::bad_alloc& obj)
|
||||
{
|
||||
VERIFY( true );
|
||||
}
|
||||
catch(...)
|
||||
{
|
||||
VERIFY( false );
|
||||
}
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
test01();
|
||||
return 0;
|
||||
}
|
|
@ -1,32 +0,0 @@
|
|||
//
|
||||
// Copyright (C) 2004-2019 Free Software Foundation, Inc.
|
||||
//
|
||||
// This file is part of the GNU ISO C++ Library. This library is free
|
||||
// software; you can redistribute it and/or modify it under the
|
||||
// terms of the GNU General Public License as published by the
|
||||
// Free Software Foundation; either version 3, or (at your option)
|
||||
// any later version.
|
||||
//
|
||||
// This library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License along
|
||||
// with this library; see the file COPYING3. If not see
|
||||
// <http://www.gnu.org/licenses/>.
|
||||
|
||||
// { dg-options "-Wno-deprecated" }
|
||||
|
||||
// 20.4.1.1 allocator members
|
||||
|
||||
#include <ext/array_allocator.h>
|
||||
#include <testsuite_allocator.h>
|
||||
|
||||
int main()
|
||||
{
|
||||
typedef int value_type;
|
||||
typedef __gnu_cxx::array_allocator<value_type> allocator_type;
|
||||
__gnu_test::check_allocate_max_size<allocator_type>();
|
||||
return 0;
|
||||
}
|
|
@ -1,33 +0,0 @@
|
|||
//
|
||||
// Copyright (C) 2004-2019 Free Software Foundation, Inc.
|
||||
//
|
||||
// This file is part of the GNU ISO C++ Library. This library is free
|
||||
// software; you can redistribute it and/or modify it under the
|
||||
// terms of the GNU General Public License as published by the
|
||||
// Free Software Foundation; either version 3, or (at your option)
|
||||
// any later version.
|
||||
//
|
||||
// This library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License along
|
||||
// with this library; see the file COPYING3. If not see
|
||||
// <http://www.gnu.org/licenses/>.
|
||||
|
||||
// { dg-options "-Wno-deprecated" }
|
||||
|
||||
// 20.4.1.1 allocator members
|
||||
|
||||
#include <ext/array_allocator.h>
|
||||
#include <testsuite_allocator.h>
|
||||
|
||||
int main()
|
||||
{
|
||||
typedef int value_type;
|
||||
typedef __gnu_cxx::array_allocator<value_type> allocator_type;
|
||||
__gnu_test::check_deallocate_null<allocator_type>();
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -1,37 +0,0 @@
|
|||
// 2001-11-25 Phil Edwards <pme@gcc.gnu.org>
|
||||
//
|
||||
// Copyright (C) 2001-2019 Free Software Foundation, Inc.
|
||||
//
|
||||
// This file is part of the GNU ISO C++ Library. This library is free
|
||||
// software; you can redistribute it and/or modify it under the
|
||||
// terms of the GNU General Public License as published by the
|
||||
// Free Software Foundation; either version 3, or (at your option)
|
||||
// any later version.
|
||||
//
|
||||
// This library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License along
|
||||
// with this library; see the file COPYING3. If not see
|
||||
// <http://www.gnu.org/licenses/>.
|
||||
|
||||
// { dg-options "-Wno-deprecated" }
|
||||
|
||||
// 20.4.1.1 allocator members
|
||||
|
||||
#include <cstdlib>
|
||||
#include <ext/array_allocator.h>
|
||||
#include <replacement_memory_operators.h>
|
||||
|
||||
int main()
|
||||
{
|
||||
typedef unsigned int value_type;
|
||||
typedef std::tr1::array<value_type, 15> array_type;
|
||||
typedef __gnu_cxx::array_allocator<value_type, array_type> allocator_type;
|
||||
array_type store;
|
||||
allocator_type a(&store);
|
||||
__gnu_test::check_delete<allocator_type, false>(a);
|
||||
return 0;
|
||||
}
|
|
@ -1,37 +0,0 @@
|
|||
// 2001-11-25 Phil Edwards <pme@gcc.gnu.org>
|
||||
//
|
||||
// Copyright (C) 2001-2019 Free Software Foundation, Inc.
|
||||
//
|
||||
// This file is part of the GNU ISO C++ Library. This library is free
|
||||
// software; you can redistribute it and/or modify it under the
|
||||
// terms of the GNU General Public License as published by the
|
||||
// Free Software Foundation; either version 3, or (at your option)
|
||||
// any later version.
|
||||
//
|
||||
// This library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License along
|
||||
// with this library; see the file COPYING3. If not see
|
||||
// <http://www.gnu.org/licenses/>.
|
||||
|
||||
// { dg-options "-Wno-deprecated" }
|
||||
|
||||
// 20.4.1.1 allocator members
|
||||
|
||||
#include <cstdlib>
|
||||
#include <ext/array_allocator.h>
|
||||
#include <replacement_memory_operators.h>
|
||||
|
||||
int main()
|
||||
{
|
||||
typedef unsigned int value_type;
|
||||
typedef std::tr1::array<value_type, 15> array_type;
|
||||
typedef __gnu_cxx::array_allocator<value_type, array_type> allocator_type;
|
||||
array_type store;
|
||||
allocator_type a(&store);
|
||||
__gnu_test::check_new<allocator_type, false>(a);
|
||||
return 0;
|
||||
}
|
|
@ -1,49 +0,0 @@
|
|||
// { dg-do run { target c++11 } }
|
||||
// { dg-options "-Wno-deprecated" }
|
||||
|
||||
// 2007-10-27 Paolo Carlini <pcarlini@suse.de>
|
||||
|
||||
// Copyright (C) 2007-2019 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/>.
|
||||
|
||||
// 20.4.1.1 allocator members
|
||||
|
||||
#include <ext/array_allocator.h>
|
||||
#include <utility>
|
||||
#include <testsuite_hooks.h>
|
||||
|
||||
void test01()
|
||||
{
|
||||
typedef std::pair<int, char> pair_type;
|
||||
typedef std::tr1::array<pair_type, 3> array_type;
|
||||
array_type store;
|
||||
|
||||
__gnu_cxx::array_allocator<pair_type, array_type> alloc1(&store);
|
||||
pair_type* ptp1 = alloc1.allocate(1);
|
||||
alloc1.construct(ptp1, 3, 'a');
|
||||
|
||||
VERIFY( ptp1->first == 3 );
|
||||
VERIFY( ptp1->second == 'a' );
|
||||
|
||||
alloc1.deallocate(ptp1, 1);
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
test01();
|
||||
return 0;
|
||||
}
|
|
@ -24,7 +24,6 @@
|
|||
// subdirectory that are meant to be directly included.
|
||||
|
||||
#include <ext/algorithm>
|
||||
#include <ext/array_allocator.h>
|
||||
#include <ext/atomicity.h>
|
||||
#include <ext/bitmap_allocator.h>
|
||||
#if _GLIBCXX_HAVE_ICONV
|
||||
|
|
Loading…
Add table
Reference in a new issue