Compiling GCC With a C++ Compiler (g++)
Joseph S. Myers
jsm@polyomino.org.uk
Wed Oct 13 22:53:00 GMT 2004
On Wed, 13 Oct 2004, Gabriel Dos Reis wrote:
> | Yes. The lvalue here is '(*p).fu', which has type 'int' and therefore
> | is a modifiable lvalue.
>
> No. The lvalue *p, of type S, is not modifiable.
But the requirement for a modifiable lvalue is the constraint in 6.5.16#1,
"An assignment operator shall have a modifiable lvalue as its left
operand.". The left operand if (*p).fu. (*p).fu is a modifiable lvalue.
A modifiable lvalue may well have operands which are not modifiable
lvalues; this is irrelevant as long as the operand of the assignment
operator is a modifiable lvalue, which it is.
--
Joseph S. Myers http://www.srcf.ucam.org/~jsm28/gcc/
jsm@polyomino.org.uk (personal mail)
joseph@codesourcery.com (CodeSourcery mail)
jsm28@gcc.gnu.org (Bugzilla assignments and CCs)
More information about the Gcc
mailing list