summaryrefslogtreecommitdiff
path: root/libstdc++-v3/include
diff options
context:
space:
mode:
authorredi <redi@138bc75d-0d04-0410-961f-82ee72b054a4>2014-04-14 14:51:35 +0000
committerredi <redi@138bc75d-0d04-0410-961f-82ee72b054a4>2014-04-14 14:51:35 +0000
commit96f7a32d978a86dd78b86eeb1fa0e193d0370383 (patch)
tree65c53e6245c00a6bf849c805d27c738ffc2b46cc /libstdc++-v3/include
parent00258a374d52e7371422d0315e5031f5965eca4c (diff)
downloadgcc-96f7a32d978a86dd78b86eeb1fa0e193d0370383.tar.gz
Limit operations on vector::pointer to NullablePointer requirements.
* include/bits/stl_vector.h (_Vector_base::_Vector_impl, _Vector_base::_M_allocate): NullablePointer requirements do not include initialization from literal zero, use value-initialization. * include/bits/vector.tcc (vector::_M_insert_aux, vector::_M_explace_back_aux): Likewise for assignment. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@209377 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3/include')
-rw-r--r--libstdc++-v3/include/bits/stl_vector.h8
-rw-r--r--libstdc++-v3/include/bits/vector.tcc6
2 files changed, 7 insertions, 7 deletions
diff --git a/libstdc++-v3/include/bits/stl_vector.h b/libstdc++-v3/include/bits/stl_vector.h
index 7e52fde55b1..3d3a2cf9f8c 100644
--- a/libstdc++-v3/include/bits/stl_vector.h
+++ b/libstdc++-v3/include/bits/stl_vector.h
@@ -84,17 +84,17 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
pointer _M_end_of_storage;
_Vector_impl()
- : _Tp_alloc_type(), _M_start(0), _M_finish(0), _M_end_of_storage(0)
+ : _Tp_alloc_type(), _M_start(), _M_finish(), _M_end_of_storage()
{ }
_Vector_impl(_Tp_alloc_type const& __a) _GLIBCXX_NOEXCEPT
- : _Tp_alloc_type(__a), _M_start(0), _M_finish(0), _M_end_of_storage(0)
+ : _Tp_alloc_type(__a), _M_start(), _M_finish(), _M_end_of_storage()
{ }
#if __cplusplus >= 201103L
_Vector_impl(_Tp_alloc_type&& __a) noexcept
: _Tp_alloc_type(std::move(__a)),
- _M_start(0), _M_finish(0), _M_end_of_storage(0)
+ _M_start(), _M_finish(), _M_end_of_storage()
{ }
#endif
@@ -167,7 +167,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
_M_allocate(size_t __n)
{
typedef __gnu_cxx::__alloc_traits<_Tp_alloc_type> _Tr;
- return __n != 0 ? _Tr::allocate(_M_impl, __n) : 0;
+ return __n != 0 ? _Tr::allocate(_M_impl, __n) : pointer();
}
void
diff --git a/libstdc++-v3/include/bits/vector.tcc b/libstdc++-v3/include/bits/vector.tcc
index 1eff51447a1..299e6142498 100644
--- a/libstdc++-v3/include/bits/vector.tcc
+++ b/libstdc++-v3/include/bits/vector.tcc
@@ -362,7 +362,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
#else
__x);
#endif
- __new_finish = 0;
+ __new_finish = pointer();
__new_finish
= std::__uninitialized_move_if_noexcept_a
@@ -412,7 +412,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
{
_Alloc_traits::construct(this->_M_impl, __new_start + size(),
std::forward<_Args>(__args)...);
- __new_finish = 0;
+ __new_finish = pointer();
__new_finish
= std::__uninitialized_move_if_noexcept_a
@@ -493,7 +493,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
std::__uninitialized_fill_n_a(__new_start + __elems_before,
__n, __x,
_M_get_Tp_allocator());
- __new_finish = 0;
+ __new_finish = pointer();
__new_finish
= std::__uninitialized_move_if_noexcept_a