OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc2/] [gcc/] [testsuite/] [g++.dg/] [eh/] [dtor1.C] - Diff between revs 301 and 384

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

Rev 301 Rev 384
// PR c++/411
// PR c++/411
// Test that a fully-constructed base is destroyed before transferring
// Test that a fully-constructed base is destroyed before transferring
// control to the handler of a function-try-block.
// control to the handler of a function-try-block.
// { dg-do run }
// { dg-do run }
int ad;
int ad;
int r;
int r;
struct A {
struct A {
  ~A() { ++ad; }
  ~A() { ++ad; }
};
};
struct B: public A {
struct B: public A {
  ~B();
  ~B();
};
};
B::~B ()
B::~B ()
try
try
  {
  {
    throw 1;
    throw 1;
  }
  }
catch (...)
catch (...)
  {
  {
    if (!ad)
    if (!ad)
      r = 1;
      r = 1;
    return;
    return;
  }
  }
int main ()
int main ()
{
{
  { B b; }
  { B b; }
  return r;
  return r;
}
}
 
 

powered by: WebSVN 2.1.0

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