Dead
[official-gcc.git] / gomp-20050608-branch / gcc / testsuite / g++.old-deja / g++.jason / ref9.C
blobdb442628090cc6c6e58a07f2aece61d71e7fe35a
1 // { dg-do run  }
2 // Bug: g++ re-evaluates the initializer for r before calling f(); since i has
3 // changed to an invalid index, this breaks.
5 class C
7 public:
8   void f () { }
9 };
11 void foo (C * objs[])
13   int i = 0;
14   C & r = * objs[i];    /* make reference to element */
16   i = 666;
17   r.f ();               /* core dumps here */
20 int
21 main ()
23   C * objs[1] = { new C };
25   foo (objs);