2003-12-26 Guilhem Lavaux <guilhem@kaffe.org>
[official-gcc.git] / gcc / testsuite / g++.dg / inherit / thunk1.C
blob4426419e9daf4c6428b6c1eca7d92b06d2638871
1 // { dg-do run { target i?86-*-* x86_64-*-* s390*-*-* alpha*-*-* ia64-*-* } }
3 #include <stdarg.h>
5 extern "C" void abort ();
7 struct A {
8   virtual void f (int, ...) {}
9   int i;
12 struct B : virtual public A {
15 struct C : public B {
16   C ();
17   virtual void f (int, ...);
20 extern C* cp;
22 C::C () { cp = this; }
24 void C::f (int i, ...) {
25   if (this != cp)
26     abort ();
27   va_list ap;
28   if (i != 3)
29     abort ();
30   va_start (ap, i);
31   if (va_arg (ap, int) != 7)
32     abort ();
33   va_end (ap);
36 C* cp = new C;
38 int main () 
40   cp->f (3, 7);