URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Only display areas with differences |
Details |
Blame |
View Log
Rev 305 |
Rev 338 |
// { dg-do run }
|
// { dg-do run }
|
|
|
// Copyright (C) 2000 Free Software Foundation, Inc.
|
// Copyright (C) 2000 Free Software Foundation, Inc.
|
// Contributed by Nathan Sidwell 8 Mar 2000
|
// Contributed by Nathan Sidwell 8 Mar 2000
|
|
|
// Derived from PR#7
|
// Derived from PR#7
|
|
|
// We need to destroy the thrown object when exiting the catch
|
// We need to destroy the thrown object when exiting the catch
|
// clause. That needs to destroy the original thrown object, not
|
// clause. That needs to destroy the original thrown object, not
|
// the caught one (which might be a base).
|
// the caught one (which might be a base).
|
|
|
static int ok = 0;
|
static int ok = 0;
|
|
|
struct A
|
struct A
|
{
|
{
|
A (){}
|
A (){}
|
virtual ~A () {}
|
virtual ~A () {}
|
};
|
};
|
|
|
struct B : virtual A
|
struct B : virtual A
|
{
|
{
|
int value;
|
int value;
|
B ()
|
B ()
|
:value(10)
|
:value(10)
|
{}
|
{}
|
~B()
|
~B()
|
{
|
{
|
if (value == 10)
|
if (value == 10)
|
ok = 1;
|
ok = 1;
|
}
|
}
|
};
|
};
|
|
|
int main()
|
int main()
|
{
|
{
|
try {
|
try {
|
throw B ();
|
throw B ();
|
} catch (A & e) {
|
} catch (A & e) {
|
}
|
}
|
return !ok;
|
return !ok;
|
}
|
}
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.