This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Is it ok to refer to a member of a const reference on the right side of the assignment?
- From: Patrick Horgan <phorgan1 at yahoo dot com>
- To: GCC-help <gcc-help at gcc dot gnu dot org>
- Date: Sun, 19 Sep 2010 22:20:00 -0700
- Subject: Is it ok to refer to a member of a const reference on the right side of the assignment?
- Reply-to: phorgan1 at yahoo dot com
This gives a seg fault on the access to the model member of op, since at
that point the &op is 0.
const
operand& op = (*top->operands).select(0, op.model);
Should this work? Can you refer on the right side of the assignment to
the const reference?
Patrick