This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[C++ PATCH] Fix all rvalue references PRs
- From: "Doug Gregor" <doug dot gregor at gmail dot com>
- To: "GCC Patches" <gcc-patches at gcc dot gnu dot org>, "Paolo Carlini" <pcarlini at suse dot de>, "Jason Merrill" <jason at redhat dot com>
- Date: Mon, 5 Nov 2007 09:42:37 -0500
- Subject: [C++ PATCH] Fix all rvalue references PRs
This patch fixes the three outstanding PRs against the rvalue
references implementation in the C++0x mode. It's really three trivial
patches rolled into one.
33996: This is a case where merge_types was failing to preserve rvalue
references. The fix is to use cp_build_reference_type, not
build_reference_type.
33235: This is a case where having a trivial constructor was causing
us to elide a move constructor. The fix is to not elide move
constructors in move_over_call.
33930: This is a case where we were having trouble overloading between
a const lvalue reference and a (non-const) rvalue reference. Turns out
that compare_ics just needed to properly fall through to the
lvalue-vs-rvalue comparison if the cv-qualification comparison of an
ICS didn't give us an answer.
Paolo, could you try this patch against some of the library work
you've been doing? I know some of these test cases are distilled from
examples from the C++0x library.
Tested i686-pc-linux-gnu. Okay for mainline?
- Doug
2007-11-05 Douglas Gregor <doug.gregor@gmail.com>
PR c++/33996
PR c++/33235
PR c++/33930
* typeck.c (merge_types): Don't lose rvalue references when
merging types.
* call.c (build_over_call): Don't elide move constructors just
because the copy constructor is trivial (!).
(compare_ics): If comparing cv-qualifiers fails, we can still order
based on binding lvalues vs. rvalues.
2007-11-05 Douglas Gregor <doug.gregor@gmail.com>
PR c++/33996
PR c++/33235
PR c++/33930
* g++.dg/cpp0x/pr33996.C: New
* g++.dg/cpp0x/rv-trivial-bug.C: New
* g++.dg/cpp0x/pr33930.C: New