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

Subversion Repositories openrisc

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

Compare with Previous | Blame | View Log

// { dg-do run }
// PR c++/22132

extern "C" void abort ();

struct foo {
  int a;
  int b;
};

class Foobar : public foo {
public:
  Foobar() { a = 1; b = 2; };
  virtual ~Foobar() {};
};

Foobar obj;
const Foobar* objPtr = &obj;
foo* f = (foo*)objPtr;

int main () {
  if (f->a != 1 || f->b != 2)
    abort ();
}

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.