stl_bvector.h (__fill_bvector(_Bit_type*, unsigned int, unsigned int, bool)): Change signature.

2017-06-16  François Dumont  <fdumont@gcc.gnu.org>

	* include/bits/stl_bvector.h
	(__fill_bvector(_Bit_type*, unsigned int, unsigned int, bool)):
	Change signature.
	(std::fill(_Bit_iterator, _Bit_iterator, bool)): Adapt.
	(_Bvector_impl_data): New.
	(_Bvector_impl): Inherits from latter.
	(_Bvector_impl(_Bit_alloc_type&&)): Delete.
	(_Bvector_impl(_Bvector_impl&&)): New, default.
	(_Bvector_base()): Default.
	(_Bvector_base(_Bvector_base&&)): Default.
	(_Bvector_base::_M_move_data(_Bvector_base&&)): New.
	(vector(vector&&, const allocator_type&)): Use latter.
	(vector<bool>::operator=(vector&&)): Likewise.
	(vector<bool>::vector()): Default.
	(vector<bool>::vector(vector&&)): Default.
	(vector<bool>::assign(_InputIterator, _InputIterator)): Use
	_M_assign_aux.
	(vector<bool>::assign(initializer_list<bool>)): Likewise.
	(vector<bool>::_M_initialize_value(bool)): New.
	(vector<bool>(size_type, const bool&, const allocator_type&)): Use
	latter.
	(vector<bool>::_M_initialize_dispatch(_Integer, _Integer, __true_type)):
	Likewise.
	(vector<bool>::_M_fill_assign(size_t, bool)): Likewise.

From-SVN: r249235
This commit is contained in:
François Dumont 2017-06-16 05:28:06 +00:00
parent c3684b7b86
commit 7d594224c2
3 changed files with 823 additions and 699 deletions

View File

@ -1,3 +1,30 @@
2017-06-16 François Dumont <fdumont@gcc.gnu.org>
* include/bits/stl_bvector.h
(__fill_bvector(_Bit_type*, unsigned int, unsigned int, bool)):
Change signature.
(std::fill(_Bit_iterator, _Bit_iterator, bool)): Adapt.
(_Bvector_impl_data): New.
(_Bvector_impl): Inherits from latter.
(_Bvector_impl(_Bit_alloc_type&&)): Delete.
(_Bvector_impl(_Bvector_impl&&)): New, default.
(_Bvector_base()): Default.
(_Bvector_base(_Bvector_base&&)): Default.
(_Bvector_base::_M_move_data(_Bvector_base&&)): New.
(vector(vector&&, const allocator_type&)): Use latter.
(vector<bool>::operator=(vector&&)): Likewise.
(vector<bool>::vector()): Default.
(vector<bool>::vector(vector&&)): Default.
(vector<bool>::assign(_InputIterator, _InputIterator)): Use
_M_assign_aux.
(vector<bool>::assign(initializer_list<bool>)): Likewise.
(vector<bool>::_M_initialize_value(bool)): New.
(vector<bool>(size_type, const bool&, const allocator_type&)): Use
latter.
(vector<bool>::_M_initialize_dispatch(_Integer, _Integer, __true_type)):
Likewise.
(vector<bool>::_M_fill_assign(size_t, bool)): Likewise.
2017-06-15 François Dumont <fdumont@gcc.gnu.org>
* src/c++98/tree.cc [!_GLIBCXX_INLINE_VERSION]

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,67 @@
// Copyright (C) 2017 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-do run { target c++11 } }
// { dg-options "-O0" }
// { dg-xfail-run-if "PR c++/65816" { *-*-* } }
#include <vector>
#include <testsuite_hooks.h>
#include <testsuite_allocator.h>
#include <ext/aligned_buffer.h>
using T = bool;
using __gnu_test::default_init_allocator;
void test01()
{
typedef default_init_allocator<T> alloc_type;
typedef std::vector<T, alloc_type> test_type;
__gnu_cxx::__aligned_buffer<test_type> buf;
__builtin_memset(buf._M_addr(), ~0, sizeof(test_type));
test_type *tmp = ::new(buf._M_addr()) test_type;
VERIFY( tmp->get_allocator().state == 0 );
tmp->~test_type();
}
void test02()
{
typedef default_init_allocator<T> alloc_type;
typedef std::vector<T, alloc_type> test_type;
__gnu_cxx::__aligned_buffer<test_type> buf;
__builtin_memset(buf._M_addr(), ~0, sizeof(test_type));
test_type *tmp = ::new(buf._M_addr()) test_type();
VERIFY( tmp->get_allocator().state == 0 );
tmp->~test_type();
}
int main()
{
test01();
test02();
return 0;
}