OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [g++.dg/] [inherit/] [thunk1.C] - Rev 816

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);
}

Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.