Re: MI: fix base members in references

Nick Roberts
2006-12-07T02:22:08Z

> > How should this behave if parent->value is a reference to a pointer?
> > Shouldn't it follow the ref, and then behave the same as when it's a
> > pointer? If so, then the fix would be something like this instead
> > (not that I understand this code):

More generally variable objects still don't seem to work (even with
Vladimir's yet to be committed patch) for references to pointers.

Assuming that the test program below makes sense, a variable object for n1
has a value which includes the address and reports the value has changed
(as it used to do for pure references)

--
Nick http://www.inet.net.nz/~nickrob

int main ()
{
int *n;
int *&n1 = n;
n = new int;
*n = 1;
}

The initial program I tested with was a variation of Vladimir's

struct S { int i; int j; };

int main()
{
S *s;
S *&s1 = s;
s = new S;
s->i = 1;
s->j = 2;
}

The variable object for s1 didn't behave correctly.