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/] [ctor1.C] - Rev 384
Compare with Previous | Blame | View Log
// { dg-do run }
// Copyright (C) 2001 Free Software Foundation, Inc.
// Contributed by Nathan Sidwell 26 Dec 2001 <nathan@nathan@codesourcery.com>
// PR 411
bool was_f_in_Bar_destroyed=false;
struct Foo
{
~Foo()
{
was_f_in_Bar_destroyed=true;
}
};
struct Bar
{
~Bar()
{
throw 1;
}
Foo f;
};
int main()
{
try
{
Bar f;
}
catch(int i)
{
if(was_f_in_Bar_destroyed)
{
return 0;
}
}
return 1;
}