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

Linus Torvalds <> writes:

| On 13 Dec 2001, Gabriel Dos Reis wrote:
| > Linus Torvalds <> writes:
| >
| > | In short: we convert that lvalue to a rvalue, because the expression has a
| >
| > If the standard say the expression is an lvalue, on what basis shoulc
| > GCC/g++ decide to convert it to an rvalue?
| All expressions have a value that they return.
| That value is the rvalue.

>From C++ definition:

  [Note: some built-in operators expect lvalue operands. [Example:
  built-in assignment operators all expect their left hand operands to
  be lvalues. ] Other built-in operators yield rvalues, and some
  expect them. [Example: the unary and binary + operators expect
  rvalue arguments and yield rvalue results. ] The discus-sion of each
  built-in operator in clause 5 indicates whether it expects lvalue
  operands and whether it yields an lvalue. ]

| The fact that the expression is an lvalue doesn't change that.

It does.

-- Gaby

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