This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/53657] New: [C++11] pair(pair&&) move constructor is non-trivial
- From: "redi at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 13 Jun 2012 14:53:00 +0000
- Subject: [Bug libstdc++/53657] New: [C++11] pair(pair&&) move constructor is non-trivial
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53657
Bug #: 53657
Summary: [C++11] pair(pair&&) move constructor is non-trivial
Classification: Unclassified
Product: gcc
Version: 4.7.1
Status: UNCONFIRMED
Keywords: ABI
Severity: normal
Priority: P3
Component: libstdc++
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: redi@gcc.gnu.org
CC: paolo.carlini@oracle.com
As discussed in PR 53646 the std::pair move constructor is non-trivial and so
causes an unfortunate ABI change where std::pair gets returned from functions
by invisible reference instead of in registers.
Defaulting it makes it trivial, but causes other problems:
// XXX Defaulted?!? Breaks std::map!!!
pair(pair&& __p)
noexcept(__and_<is_nothrow_move_constructible<_T1>,
is_nothrow_move_constructible<_T2>>::value)
: first(std::forward<first_type>(__p.first)),
second(std::forward<second_type>(__p.second)) { }