This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/15764] no cleanup if temporary's dtor terminates with an exception
- From: "boris at kolpackov dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 1 Jun 2004 17:53:01 -0000
- Subject: [Bug c++/15764] no cleanup if temporary's dtor terminates with an exception
- References: <20040601170320.15764.boris@kolpackov.net>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From boris at kolpackov dot net 2004-06-01 17:52 -------
$ cat >test.cxx
#include <iostream>
using std::cerr;
using std::endl;
struct a
{
~a ()
{
throw 1;
}
};
int
f (a const& acr = a ())
{
return 1;
}
struct b
{
b (int)
{
cerr << "b" << endl;
}
~b ()
{
cerr << "~b" << endl;
// std::abort ();
}
};
int
main ()
{
try
{
b b_ (f ());
}
catch (...) {}
}
$ g++ test.cxx
$ ./a.out
b
$ #?
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15764