vector<bool> _M_start and 0 offset
authorMarc Glisse <marc.glisse@inria.fr>
Tue, 2 Oct 2018 14:59:25 +0000 (16:59 +0200)
committerMarc Glisse <glisse@gcc.gnu.org>
Tue, 2 Oct 2018 14:59:25 +0000 (14:59 +0000)
2018-10-02  Marc Glisse  <marc.glisse@inria.fr>

PR libstdc++/87258
* include/bits/stl_bvector.h (vector::begin(), vector::cbegin()):
Rebuild _M_start with an explicit 0 offset.

From-SVN: r264791

libstdc++-v3/ChangeLog
libstdc++-v3/include/bits/stl_bvector.h

index 388ae9d90692e849da615b956fea3c47209227a1..30ff00af1397c3654e550db395bd182af64860b2 100644 (file)
@@ -1,3 +1,9 @@
+2018-10-02  Marc Glisse  <marc.glisse@inria.fr>
+
+       PR libstdc++/87258
+       * include/bits/stl_bvector.h (vector::begin(), vector::cbegin()):
+       Rebuild _M_start with an explicit 0 offset.
+
 2018-10-02  Jonathan Wakely  <jwakely@redhat.com>
 
        * include/std/variant (__gen_vtable_impl::__visit_invoke): Call __get
index 4527ce7832aa99c941f9f7ef54278b4af19c98d5..19c16839cfaee3a4bd21f860d80f6e49ca3b2536 100644 (file)
@@ -809,11 +809,11 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
 
       iterator
       begin() _GLIBCXX_NOEXCEPT
-      { return this->_M_impl._M_start; }
+      { return iterator(this->_M_impl._M_start._M_p, 0); }
 
       const_iterator
       begin() const _GLIBCXX_NOEXCEPT
-      { return this->_M_impl._M_start; }
+      { return const_iterator(this->_M_impl._M_start._M_p, 0); }
 
       iterator
       end() _GLIBCXX_NOEXCEPT
@@ -842,7 +842,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
 #if __cplusplus >= 201103L
       const_iterator
       cbegin() const noexcept
-      { return this->_M_impl._M_start; }
+      { return const_iterator(this->_M_impl._M_start._M_p, 0); }
 
       const_iterator
       cend() const noexcept