This is the mail archive of the
mailing list for the GCC project.
Re: Volatile MEMs in statement expressions and functions inlined as trees
- From: Gabriel Dos Reis <gdr at codesourcery dot com>
- To: Linus Torvalds <torvalds at transmeta dot com>
- Cc: Alexandre Oliva <aoliva at redhat dot com>, Gabriel Dos Reis <gdr at codesourcery dot com>, Richard Henderson <rth at redhat dot com>, <gcc-patches at gcc dot gnu dot org>
- Date: 14 Dec 2001 20:31:25 +0100
- Subject: Re: Volatile MEMs in statement expressions and functions inlined as trees
- Organization: CodeSourcery, LLC
- References: <Pine.LNX.firstname.lastname@example.org>
Linus Torvalds <email@example.com> writes:
| Now, that return value is not really an lvalue, but it's actually
| COULD it be a real lvalue? Yes.
The C++ definition is pretty clear about a return value of class-type:
it is an rvalue.
| I think that special case is actually a
| syntactic one, not a fundamental issue. Not making that addressable
| variable a lvalue means that the compiler on a syntactic level actually
| disallows you from taking the address of the temporary object.
If it is of class-type, then you can have its address by calling a
member function. You can even assign to it if a non-const type -- not
that not all lvalues are assignable.