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

Subversion Repositories scarts

[/] [scarts/] [trunk/] [toolchain/] [scarts-gcc/] [gcc-4.1.1/] [gcc/] [testsuite/] [g++.old-deja/] [g++.mike/] [p3068.C] - Rev 12

Compare with Previous | Blame | View Log

// { dg-do run  }
// prms-id: 3068

extern "C" int printf(const char *, ...);
extern "C" void exit(int);
 
class LB {
public:
  virtual int test() { return 0; }
  virtual ~LB() { }
protected:
  LB() { }
};

class RRB {
public:
  virtual ~RRB() { }
  virtual void test2(int a) { }
};

class RR : public RRB {
public:
    virtual ~RR() { }
};

class RL {
public:
  virtual void real(int a) {
    printf("RL::real\n");
  }
};


class R : public RL, public RR {
public:
  virtual void test3(int a) { }
  virtual void test2(int a) { }
};

class L : public LB {
};

class C : public L, public R {
public:
  C() { }
  virtual ~C() {
    printf("C::~C\n");
    exit(1);
  }
  virtual void real(int a) {
    printf("RL::real\n");
  }
};

int main() {
    C& bb = *new C;
    R& mv = bb;
    bb.real(0);
    mv.real(0);
    return 0;
}

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.