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++.mike/] [p16146.C] - Diff between revs 305 and 338

Only display areas with differences | Details | Blame | View Log

Rev 305 Rev 338
// { dg-do run  }
// { dg-do run  }
// prms-id: 16146
// prms-id: 16146
extern "C" int printf (const char *, ...);
extern "C" int printf (const char *, ...);
class myFoundation {
class myFoundation {
protected:
protected:
  myFoundation () { count = 0; }
  myFoundation () { count = 0; }
  virtual ~myFoundation () {}
  virtual ~myFoundation () {}
public:
public:
  void addRef () { ++count; }
  void addRef () { ++count; }
  void removeRef () { if (count > 0) --count; }
  void removeRef () { if (count > 0) --count; }
private:
private:
  long count;
  long count;
};
};
class firstIntermediate :virtual public myFoundation {
class firstIntermediate :virtual public myFoundation {
public:
public:
  firstIntermediate () {}
  firstIntermediate () {}
  ~firstIntermediate () {}
  ~firstIntermediate () {}
  void bar () { printf ("Bar\n"); }
  void bar () { printf ("Bar\n"); }
};
};
class firstBase :  public firstIntermediate {
class firstBase :  public firstIntermediate {
public:
public:
  firstBase () {}
  firstBase () {}
  ~firstBase () {}
  ~firstBase () {}
  virtual void g () {}
  virtual void g () {}
};
};
class secondIntermediate : virtual public myFoundation {
class secondIntermediate : virtual public myFoundation {
public:
public:
  secondIntermediate () {}
  secondIntermediate () {}
  ~secondIntermediate () {}
  ~secondIntermediate () {}
  virtual void h () {}
  virtual void h () {}
};
};
class secondBase : public secondIntermediate {
class secondBase : public secondIntermediate {
public:
public:
  secondBase () {}
  secondBase () {}
  ~secondBase () {}
  ~secondBase () {}
  virtual void h () {}
  virtual void h () {}
};
};
class typeInterface : virtual public firstBase {
class typeInterface : virtual public firstBase {
public:
public:
  typeInterface () {}
  typeInterface () {}
  ~typeInterface () {}
  ~typeInterface () {}
  virtual void i () {}
  virtual void i () {}
};
};
class classServices : virtual public firstBase,
class classServices : virtual public firstBase,
                      public secondBase {
                      public secondBase {
public:
public:
  classServices () {}
  classServices () {}
  ~classServices () {}
  ~classServices () {}
  virtual void j () {}
  virtual void j () {}
};
};
class classImplementation : public typeInterface,
class classImplementation : public typeInterface,
                            public classServices {
                            public classServices {
public:
public:
  classImplementation () {}
  classImplementation () {}
  ~classImplementation () {}
  ~classImplementation () {}
  void g () {}
  void g () {}
  void h () {}
  void h () {}
  void i () {}
  void i () {}
  void j () {}
  void j () {}
};
};
int main () {
int main () {
  firstBase* fbp = new classImplementation;
  firstBase* fbp = new classImplementation;
  classImplementation* cip = dynamic_cast  (fbp);
  classImplementation* cip = dynamic_cast  (fbp);
  cip->addRef();
  cip->addRef();
  myFoundation* mfp = cip;
  myFoundation* mfp = cip;
}
}
 
 

powered by: WebSVN 2.1.0

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