2003-12-26 Guilhem Lavaux <guilhem@kaffe.org>
[official-gcc.git] / gcc / testsuite / g++.old-deja / g++.other / crash22.C
blob0890aef4a1ed36a06b442e3b514a4c9c9a77eb2d
1 // { dg-do link  }
2 // { dg-options "-O2" }
4 class foo
6 };
8 typedef void *voidp;
9 class vect : public foo
11 public:
12   voidp& a();
13   int b();
16 class bar
18 public:
19   bar *c(bool (*f)(bar *node), voidp g)
20     {
21       int i=0;
22       bool j;
23       while (i < d.b()){
24         j = (f == __null) || f((bar*)d.a());
25         if (j)
26           ((bar*)d.a())->c(f, g);
27         i++;
28       }
29       return this;
30     }
31  public:
32   vect d;
33   bar *e(foo *k);
36 bar *bar::e(foo *k)
38   return c(__null, k);
41 voidp &vect::a()
43   static voidp x;
44   return x;
47 int vect::b()
49   static int x;
50   return x;
53 int main()
55   return 0;