This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/59876] New: _Rb_tree move constructor invokes _M_copy
- From: "drahflow at gmx dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sun, 19 Jan 2014 09:06:14 +0000
- Subject: [Bug libstdc++/59876] New: _Rb_tree move constructor invokes _M_copy
- Auto-submitted: auto-generated
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.