[Bug libstdc++/59876] New: _Rb_tree move constructor invokes _M_copy

drahflow at gmx dot de gcc-bugzilla@gcc.gnu.org
Sun Jan 19 09:06:00 GMT 2014


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59876

            Bug ID: 59876
           Summary: _Rb_tree move constructor invokes _M_copy
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: drahflow at gmx dot de

#include <map>
#include <memory>

using namespace std;

int main(void) {
  map<int, unique_ptr<int>> m1;
  map<int, unique_ptr<int>> m2(move(m1));
}

fails to compile under 4.9 (but works fine with 4.7 and 4.8).



A change was introduced in 4.9 after which the move constructor of _Rb_tree
invokes _M_copy on a range of elements (which might not be copy-constructible).

Cursory analysis suggests the problem is at
/usr/include/c++/4.9/bits/stl_tree.h line 1021.



More information about the Gcc-bugs mailing list