This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/53646] Surprising effects of cxx11 vs cxx98 ABI compatibility
- From: "matz at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 12 Jun 2012 15:36:01 +0000
- Subject: [Bug libstdc++/53646] Surprising effects of cxx11 vs cxx98 ABI compatibility
- Auto-submitted: auto-generated
- References: <bug-53646-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53646
--- Comment #5 from Michael Matz <matz at gcc dot gnu.org> 2012-06-12 15:36:01 UTC ---
(In reply to comment #2)
> N.B. std::pair is not a POD in c++98 or c++11, so I don't know what libstdc++
> could have done to cause the FE to change how it returns a std::pair.
I don't know if it's PODness (but I believe that it is), but the calling
convention is changed by the existence of this c++11 construct in std::pair:
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)) { }
It's some sort of copy-ctor, right? In any case when it's there (and it's
only there when compiling/preprocessing in c++11 mode), then the frontend
makes this type be TREE_ADDRESSABLE, aggregate_value_p will return true,
and that makes the ABI use an invisible reference.