This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] rvalue reference implementation for C++0x


On Wed, 2007-04-25 at 10:02 -0400, Doug Gregor wrote:
> Yes, this is definitely the right approach to the rvalue reference
> type... and you didn't have to touch the middle-end at all. Great!

Well, instead of modifying the middle end code directly, I pasted the
middle end code into the front end and modified it there. So, yeah.

> Russell, when I applied this patch to the cxx0x-branch, I ran into
> three failing test cases that I'd like you to take a look at. They
> behave differently under -std=c++0x than under -std=c++98, and I'm not
> sure if they're exploiting C++98-specific behavior or whether they are
> exposing a bug in the rvalue references implementation. The test cases
> are:

I couldn't get the cxx0x branch to compile, I can email you details if
you want, but I did look over the test cases.

>   g++.dg/init/copy7.C

The change in behavior for this test case is by design. Before C++0x,
lines 9 and 18 were considered errors

  const foo &bar = foo();
  const foo& baz = derived();

because the standard used to allow compilers to create temporary copies
of objects to bind to const references. Since the foo and derived
classes are uncopyable (they have private copy constructors) their
temporaries couldn't bind to const references. In C++0x though,
compilers are required to directly bind references like these and not
create copies, so there are no more errors. This is a change I
implemented even though it's not strictly part of the rvalue reference
proposal.

>   g++.dg/overload/arg1.C
>   g++.dg/overload/arg4.C

These two cases do look like bugs, I'll have to see what causes them.

-- 
-  Russell Yanofsky (PGP ID: 0x5FAA0216)
-  http://russ.yanofsky.org/
--

Attachment: signature.asc
Description: This is a digitally signed message part


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]