https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61946

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |ASSIGNED
   Last reconfirmed|                            |2014-07-29
      Known to work|                            |4.2.4
           Assignee|unassigned at gcc dot gnu.org      |redi at gcc dot gnu.org
            Summary|rope construction, passing  |[4.8/4.9/4.10 Regression]
                   |allocator referenct without |rope construction, passing
                   |const                       |allocator referenct without
                   |                            |const
     Ever confirmed|0                           |1

--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
The correct fix is to use _M_get_allocator() to pass a non-const reference:

--- a/libstdc++-v3/include/ext/rope
+++ b/libstdc++-v3/include/ext/rope
@@ -1876,8 +1876,9 @@ protected:
           const allocator_type& __a = allocator_type())
       : _Base(__a)
       {
-       this->_M_tree_ptr = (0 == __len) ?
-         0 : _S_new_RopeFunction(__fn, __len, __delete_fn, __a);
+       this->_M_tree_ptr = (0 == __len)
+         ? 0
+         : _S_new_RopeFunction(__fn, __len, __delete_fn, _M_get_allocator());
       }

       rope(const rope& __x, const allocator_type& __a = allocator_type())

Reply via email to