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


Linus Torvalds <torvalds@transmeta.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.

-- Gaby


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