Bug 59876 - _Rb_tree move constructor invokes _M_copy
Summary: _Rb_tree move constructor invokes _M_copy
Status: RESOLVED DUPLICATE of bug 59872
Alias: None
Product: gcc
Classification: Unclassified
Component: libstdc++ (show other bugs)
Version: 4.9.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-01-19 09:06 UTC by Jens-Wolfhard Schicke
Modified: 2014-01-19 13:45 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jens-Wolfhard Schicke 2014-01-19 09:06:14 UTC
#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.
Comment 1 Jens-Wolfhard Schicke 2014-01-19 11:58:49 UTC
Sorry, I forgot.

~ % gcc-4.9 --version
gcc-4.9 (Debian 4.9-20140116-1) 4.9.0 20140116 (experimental) [trunk revision 206688]

~ % dpkg -l libstdc++-4.9-dev:amd64
||/ Name           Version      Architecture Description
+++-==============-============-============-=================================
ii  libstdc++-4.9- 4.9-20140116 amd64        GNU Standard C++ Library v3 (deve
Comment 2 Jonathan Wakely 2014-01-19 12:49:04 UTC
isn't this a duplicate of PR 59872?
Comment 3 Jonathan Wakely 2014-01-19 13:45:42 UTC
dup

*** This bug has been marked as a duplicate of bug 59872 ***