[gnu.g++.bug] references as class member variables

schmidt@crimee.ics.uci.edu (Douglas C. Schmidt) (05/30/91)

Hi,

	I'm curious...  Does anyone know what the "proper" output for
the following program should be (or is it perhaps officially undefined?)
g++ prints 10, 11, whereas cfront 2.0 prints 11, 11.

--------------------------------------
struct Foo
{
  int &r;

  Foo (int s): r (s) { }
};

extern "C" void printf (const char *, ...);

main ()
{
  Foo f (10);
  Foo g (11);

  printf ("%d, %d\n", f.r, g.r);
}
----------------------------------------

Thanks,

	Doug
--
His life was gentle, and the elements so            | Douglas C. Schmidt
Mixed in him that nature might stand up             | (schmidt@ics.uci.edu)
And say to all the world: "This was a man."         | (714) 856-4101
   -- In loving memory of Terry Williams (1971-1991)|