This is the mail archive of the 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, Linus Torvalds <> wrote:
> On 14 Dec 2001, Gabriel Dos Reis wrote:
> >
> > According to me, that part is meaningless.  It should have been
> > written "the *value of* the result ...".
> Right. You are ignoring part of the standard, because you cannot make
> sense of it.
> You'd like to rewrite it, because you don't understand it.  You think it
> is inconsistent with the other part that you _do_ understand, and that you
> somehow think is more important.
> Classic ostrich behaviour - ignore the parts you do not like.

I agree with Gabriel Dos Reis here.

The C++ standard is a very complex document that was put together
in a situation where there was a lot of pressure to "ship it"
as soon as possible.  People were not always very precise with
their language.  And when they were precise, they weren't always

For issues like this, a single small discrepancy, of the kind that
could easily be an unintential drafting error, is not necessarily
a compelling argument for or against a particular interpretation.
It needs to be weighed up against all the other discrepancies,
contradictions, and inconsistencies that the different interpretations
give rise to.

And in this case, your interpretation has some contradictions
with the wording in the standard that are considerably more
signficiant, IMHO.

> And I'm telling you that your world-view is too limited. The earth is not
> flat, it's round. And assignments have both a rvalue _and_ a lvalue, and
> they are _both_ part of the result. You just have to know when to use
> which.

I understand your argument, but I don't think this viewpoint was shared
by most of the C++ committee involved in this.  Expressions have values,
but they don't "have" rvalues or lvalues -- they *are* rvalues or lvalues.

 | 3.10 - Lvalues and rvalues [basic.lval]
 |    -1- Every expression is either an lvalue or an rvalue.

This is an exclusive or.

Fergus Henderson <>  |  "I have always known that the pursuit
The University of Melbourne         |  of excellence is a lethal habit"
WWW: <>  |     -- the last words of T. S. Garp.

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