optimization bug

Dima Volodin dvv@dvv.ru
Tue Oct 27 09:54:00 GMT 1998


Alexandre Oliva wrote:

> Dima Volodin <dvv@dvv.ru> writes:
>
> > Did I, really? Can you quote the chapter and verse where it reads that
> > passing an argument by reference is a dereference?
>
> Passing it by reference is not a dereference, but *(T*)0 is, even if
> it is only used as an lvalue.  A long thread is going on in

> comp.std.c++ about a similar issue, namely, is &array[3] valid if
> array is define to have three element?  Or must one use array+3?

And what if you re-define & for the base class of _array_ here? Anyway, has
this thread ended with any definitive outcome? As of my own opinion - I
tend to consider passing *(T*)0 by reference as a perfectly valid construct
(together with this &array[3]) as I don't see it any more different (and
dangerous) than the zero pointer.

> Alexandre Oliva

Cheers

Dima




More information about the Gcc-bugs mailing list