URL
https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk
Only display areas with differences |
Details |
Blame |
View Log
Rev 149 |
Rev 154 |
// { dg-do run }
|
// { dg-do run }
|
// Bug: g++ fails to treat function-try-blocks in ctors specially.
|
// Bug: g++ fails to treat function-try-blocks in ctors specially.
|
// Submitted by Jason Merrill
|
// Submitted by Jason Merrill
|
|
|
int c;
|
int c;
|
int r;
|
int r;
|
|
|
struct A {
|
struct A {
|
int i;
|
int i;
|
A(int j) { i = j; }
|
A(int j) { i = j; }
|
~A() { c += i; }
|
~A() { c += i; }
|
};
|
};
|
|
|
struct B: public A {
|
struct B: public A {
|
A a;
|
A a;
|
B() try : A(1), a(2)
|
B() try : A(1), a(2)
|
{ throw 1; }
|
{ throw 1; }
|
catch (...)
|
catch (...)
|
{ if (c != 3) r |= 1; }
|
{ if (c != 3) r |= 1; }
|
};
|
};
|
|
|
int main ()
|
int main ()
|
{
|
{
|
try
|
try
|
{ B b; }
|
{ B b; }
|
catch (...)
|
catch (...)
|
{ c = 0; }
|
{ c = 0; }
|
|
|
if (c != 0) r |= 2;
|
if (c != 0) r |= 2;
|
|
|
return r;
|
return r;
|
}
|
}
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.