https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69600
Bug ID: 69600 Summary: Incorrect use of copy-assignment instead of move assignment from function Product: gcc Version: 5.3.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: sshannin at gmail dot com Target Milestone: --- Created attachment 37541 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=37541&action=edit preprocessed source In some cases, it looks like the copy assignment operator is being used to store return values from a function instead of the move assignment operator. This causes the compilation to fail because it tries to use the copy-assignment operator of some classes which may be movable only (unique_ptr). Note that changing data_t to be either 'std::map<int, inner_data>' or 'std::map<int, value_t>' allows the code to compile. Let me know if I can provide any more details that would be helpful. gcc-5.3.0 x86_64-unknown-linux-gnu