mirror of git://gcc.gnu.org/git/gcc.git
stl_vector.h (vector(size_type)): Add missing allocator parameter.
* include/bits/stl_vector.h (vector(size_type)): Add missing allocator parameter. * include/bits/stl_bvector.h: Likewise. * include/debug/vector (vector(size_type)): Likewise. * include/profile/vector (vector(size_type)): Likewise. Pass allocator to base constructor. * testsuite/23_containers/vector/requirements/dr438/assign_neg.cc: Adjust dg-error line numbers. * testsuite/23_containers/vector/requirements/dr438/ constructor_1_neg.cc: Likewise. * testsuite/23_containers/vector/requirements/dr438/ constructor_2_neg.cc: Likewise. * testsuite/23_containers/vector/requirements/dr438/insert_neg.cc: Likewise. From-SVN: r193284
This commit is contained in:
parent
aaa050aa4a
commit
d720a22b6e
|
|
@ -1,3 +1,20 @@
|
|||
2012-11-07 Jonathan Wakely <jwakely.gcc@gmail.com>
|
||||
|
||||
* include/bits/stl_vector.h (vector(size_type)): Add missing allocator
|
||||
parameter.
|
||||
* include/bits/stl_bvector.h: Likewise.
|
||||
* include/debug/vector (vector(size_type)): Likewise.
|
||||
* include/profile/vector (vector(size_type)): Likewise. Pass allocator
|
||||
to base constructor.
|
||||
* testsuite/23_containers/vector/requirements/dr438/assign_neg.cc:
|
||||
Adjust dg-error line numbers.
|
||||
* testsuite/23_containers/vector/requirements/dr438/
|
||||
constructor_1_neg.cc: Likewise.
|
||||
* testsuite/23_containers/vector/requirements/dr438/
|
||||
constructor_2_neg.cc: Likewise.
|
||||
* testsuite/23_containers/vector/requirements/dr438/insert_neg.cc:
|
||||
Likewise.
|
||||
|
||||
2012-11-06 Paolo Carlini <paolo.carlini@oracle.com>
|
||||
|
||||
PR libstdc++/51850
|
||||
|
|
|
|||
|
|
@ -555,6 +555,21 @@ template<typename _Alloc>
|
|||
vector(const allocator_type& __a)
|
||||
: _Base(__a) { }
|
||||
|
||||
#ifdef __GXX_EXPERIMENTAL_CXX0X__
|
||||
explicit
|
||||
vector(size_type __n, const allocator_type& __a = allocator_type())
|
||||
: vector(__n, false, __a)
|
||||
{ }
|
||||
|
||||
vector(size_type __n, const bool& __value,
|
||||
const allocator_type& __a = allocator_type())
|
||||
: _Base(__a)
|
||||
{
|
||||
_M_initialize(__n);
|
||||
std::fill(this->_M_impl._M_start._M_p, this->_M_impl._M_end_of_storage,
|
||||
__value ? ~0 : 0);
|
||||
}
|
||||
#else
|
||||
explicit
|
||||
vector(size_type __n, const bool& __value = bool(),
|
||||
const allocator_type& __a = allocator_type())
|
||||
|
|
@ -564,6 +579,7 @@ template<typename _Alloc>
|
|||
std::fill(this->_M_impl._M_start._M_p, this->_M_impl._M_end_of_storage,
|
||||
__value ? ~0 : 0);
|
||||
}
|
||||
#endif
|
||||
|
||||
vector(const vector& __x)
|
||||
: _Base(__x._M_get_Bit_allocator())
|
||||
|
|
|
|||
|
|
@ -261,13 +261,14 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
|
|||
/**
|
||||
* @brief Creates a %vector with default constructed elements.
|
||||
* @param __n The number of elements to initially create.
|
||||
* @param __a An allocator.
|
||||
*
|
||||
* This constructor fills the %vector with @a __n default
|
||||
* constructed elements.
|
||||
*/
|
||||
explicit
|
||||
vector(size_type __n)
|
||||
: _Base(__n)
|
||||
vector(size_type __n, const allocator_type& __a = allocator_type())
|
||||
: _Base(__n, __a)
|
||||
{ _M_default_initialize(__n); }
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -83,8 +83,8 @@ namespace __debug
|
|||
|
||||
#ifdef __GXX_EXPERIMENTAL_CXX0X__
|
||||
explicit
|
||||
vector(size_type __n)
|
||||
: _Base(__n), _M_guaranteed_capacity(__n) { }
|
||||
vector(size_type __n, const _Allocator& __a = _Allocator())
|
||||
: _Base(__n, __a), _M_guaranteed_capacity(__n) { }
|
||||
|
||||
vector(size_type __n, const _Tp& __value,
|
||||
const _Allocator& __a = _Allocator())
|
||||
|
|
|
|||
|
|
@ -84,8 +84,8 @@ namespace __profile
|
|||
|
||||
#ifdef __GXX_EXPERIMENTAL_CXX0X__
|
||||
explicit
|
||||
vector(size_type __n)
|
||||
: _Base(__n)
|
||||
vector(size_type __n, const _Allocator& __a = _Allocator())
|
||||
: _Base(__n, __a)
|
||||
{
|
||||
__profcxx_vector_construct(this, this->capacity());
|
||||
__profcxx_vector_construct2(this);
|
||||
|
|
@ -147,7 +147,7 @@ namespace __profile
|
|||
}
|
||||
|
||||
vector(const _Base& __x, const _Allocator& __a)
|
||||
: _Base(__x)
|
||||
: _Base(__x, __a)
|
||||
{
|
||||
__profcxx_vector_construct(this, this->capacity());
|
||||
__profcxx_vector_construct2(this);
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@
|
|||
// <http://www.gnu.org/licenses/>.
|
||||
|
||||
// { dg-do compile }
|
||||
// { dg-error "no matching" "" { target *-*-* } 1236 }
|
||||
// { dg-error "no matching" "" { target *-*-* } 1237 }
|
||||
|
||||
#include <vector>
|
||||
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@
|
|||
// <http://www.gnu.org/licenses/>.
|
||||
|
||||
// { dg-do compile }
|
||||
// { dg-error "no matching" "" { target *-*-* } 1166 }
|
||||
// { dg-error "no matching" "" { target *-*-* } 1167 }
|
||||
|
||||
#include <vector>
|
||||
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@
|
|||
// <http://www.gnu.org/licenses/>.
|
||||
|
||||
// { dg-do compile }
|
||||
// { dg-error "no matching" "" { target *-*-* } 1166 }
|
||||
// { dg-error "no matching" "" { target *-*-* } 1167 }
|
||||
|
||||
#include <vector>
|
||||
#include <utility>
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@
|
|||
// <http://www.gnu.org/licenses/>.
|
||||
|
||||
// { dg-do compile }
|
||||
// { dg-error "no matching" "" { target *-*-* } 1277 }
|
||||
// { dg-error "no matching" "" { target *-*-* } 1278 }
|
||||
|
||||
#include <vector>
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue