URL
https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk
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;
|
}
|
}
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.