This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] rvalue reference implementation for C++0x
On 11 Mar 2007 09:41:36 -0500, Gabriel Dos Reis <gdr@cs.tamu.edu> wrote:
"Doug Gregor" <doug.gregor@gmail.com> writes:
The overload resolution process and template argument deduction rules
are central part of the compiler that I would prefer distinct notions
-- and rvalue references *are* different from references -- get
distinct node types.
G++ has a long record of bugs related to bit fiddling for "related
notions"; many of them got eventually fixed by introducing due
abstractions that differentiate them properly.
Just so we know what we're dealing with... a quick survery shows about
157 uses of REFERENCE_TYPE in the C++ front end, plus another 55 in
the common bits. That's compared to the 22 uses of TYPE_REF_IS_RVALUE
introduced by Russell's patch.
Adding a new kind of type node means we have about 10 times as many
places to change in the compiler, including middle-end bits that
should not need to know anything about rvalue references. How many
bugs will we see down the line, when contributors for other languages
just check against REFERENCE_TYPE and not the new
RVALUE_REFERENCE_TYPE?
Keep rvalue references in the front end, minimize where we need to
differentiate between lvalue- and rvalue-references.
This is no TYPE_PTRMEMFUNC_P.
Cheers,
Doug