URL
https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk
Subversion Repositories openrisc_2011-10-31
[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [g++.dg/] [inherit/] [thunk1.C] - Rev 328
Go to most recent revision | Compare with Previous | Blame | View Log
// { dg-do run { target i?86-*-* x86_64-*-* s390*-*-* alpha*-*-* ia64-*-* sparc*-*-* } }
#include <stdarg.h>
extern "C" void abort ();
struct A {
virtual void f (int, ...) {}
int i;
};
struct B : virtual public A {
};
struct C : public B {
C ();
virtual void f (int, ...);
};
extern C* cp;
C::C () { cp = this; }
void C::f (int i, ...) {
if (this != cp)
abort ();
va_list ap;
if (i != 3)
abort ();
va_start (ap, i);
if (va_arg (ap, int) != 7)
abort ();
va_end (ap);
}
C* cp = new C;
int main ()
{
cp->f (3, 7);
}
Go to most recent revision | Compare with Previous | Blame | View Log