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

Subversion Repositories openrisc

[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc1/] [gcc/] [testsuite/] [g++.old-deja/] [g++.law/] [cvt10.C] - Rev 338

Compare with Previous | Blame | View Log

// { dg-do assemble  }
// GROUPS passed conversions
// cvt file
// Message-Id: <CC7oHn.B4F@izf.tno.nl>
// From: tom@izfcs.izf.tno.nl (Tom Vijlbrief)
// Subject: g++ 2.4.5 has problems with NON virtual shared base classes
// Date: Mon, 23 Aug 1993 12:10:34 GMT


#include        <stdio.h>

#define FAIL

class Base {
public:
  Base() { printf("Base::Base\n"); }
  virtual ~Base() { printf("Base::~Base\n"); }
  virtual void v() { printf("Base::v\n"); }
};

class Base2 {
public:
  Base2() { printf("Base2::Base2\n"); }
  virtual ~Base2() { printf("Base2::~Base2\n"); }
  virtual void v() { printf("Base2::v\n"); }
};

class A: public Base {
public:
  A() { printf("A::A\n"); }
  ~A() { printf("A::~A\n"); }
  virtual void va() { printf("A::va\n"); }
};

#ifdef FAIL
class B: public Base {
#else
class B: public Base2 {
#endif
public:
  B() { printf("B::B\n"); }
  ~B() { printf("B::~B\n"); }
  virtual void vb() { printf("B::vb\n"); }
};

class C: public A, public B {
public:
  C() { printf("C::C\n"); }
  ~C() { printf("C::~C\n"); }
  void va() { printf("C::va\n"); }
};


int main()
{
  C *cp= new C;
  cp->va();
  delete cp;
}

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.