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: Volatile MEMs in statement expressions and functions inlined as trees



On 14 Dec 2001, Gabriel Dos Reis wrote:
>
> | But I'll give you that some rvalues can be _promoted_ to lvalues.
>
> There is no such rules C++.  You're inventing here.

You already yourself pointed out some of the things allow the programmer
to see the address of the rvalue.

Once you have an address of an rvalue, you can _always_ make it an lvalue
by the simple method of dereferencing it with "*".

In effect, operations that expose the address of rvalues thus allow their
promotion into lvalues. What's your argument?

Normally, of course, it goes the other way (ie lvalues get "demoted" to
rvalues), by virtue of the operations wanting rvalues. A simple example,
of course is just

	int a, b, c;
	a = b+c;

where "b" is a lvalue, but because the "+" operation wants a rvalue it
gets automatically converted, and the rvalue created by the dereferencing
of "b".

Or do you disagree here too?

		Linus


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