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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [g++.dg/] [rtti/] [dyncast4.C] - Rev 301

Compare with Previous | Blame | View Log

// Test to make sure that we keep searching if we don't find the type we
// want at the expected address.

// { dg-do run }

struct A
{
  virtual void f() {};
};

struct B: A { };

struct C: A { };

struct D: B, C { };

int main()
{
  D d;
  A* ap = static_cast<B*>(&d);
  C* cp = dynamic_cast<C*>(ap);
  if (cp == 0)
    return 1;
  else
    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.