]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Limit operations on vector::pointer to NullablePointer requirements.
authorJonathan Wakely <jwakely@redhat.com>
Mon, 14 Apr 2014 14:51:35 +0000 (15:51 +0100)
committerJonathan Wakely <redi@gcc.gnu.org>
Mon, 14 Apr 2014 14:51:35 +0000 (15:51 +0100)
* 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.

From-SVN: r209377

libstdc++-v3/ChangeLog
libstdc++-v3/include/bits/stl_vector.h
libstdc++-v3/include/bits/vector.tcc

index 1d0e19a4e51d3d4a3c84ccfe47a3677bd3a364c2..a2ea772f5d593504d74f010e7764127cdc7ea505 100644 (file)
@@ -1,3 +1,11 @@
+2014-04-14  Jonathan Wakely  <jwakely@redhat.com>
+
+       * 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.
+
 2014-04-11  Marc Glisse  <marc.glisse@inria.fr>
 
        PR libstdc++/59434
index 7e52fde55b1be4e9f8700f52bc50bf35e9b84a7b..3d3a2cf9f8c2fcb499eea7409d690e99453d4091 100644 (file)
@@ -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
index 1eff51447a19ef59e87a5bbafdeccdda99ead91b..299e61424986ca8a2d532e9ab838ba5016ba4b0a 100644 (file)
@@ -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