This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/13944] New: exception in constructor of a class to be thrown is not caught
- From: "debian-gcc at lists dot debian dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 31 Jan 2004 12:02:14 -0000
- Subject: [Bug c++/13944] New: exception in constructor of a class to be thrown is not caught
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
[forwarded from http://bugs.debian.org/228099]
Running the following code compiled with 'g++ 3.3.3 testex.cc' results in a
SIGABRT. The bug submitter sees no reason why this should happen. With g++ 3.2.3
it works, i.e. the exception 1 in A() is caught by the try-block.
# 1 "testex.cc"
# 1 "<built-in>"
# 1 "<command line>"
# 1 "testex.cc"
class A
{
public:
A() {throw(1);}
};
int main(int argc, char *argv)
{
try
{
throw A();
}
catch(...)
{
}
}
gcc-3.4 (CVS 20040113) and 3.5 (CVS 20040113 tree-ssa) are more verbose:
$ g++-3.4 bug-228099.cc && ./a.out
terminate called after throwing an instance of 'i'
Aborted
$ g++-3.5 bug-228099.cc && ./a.out
terminate called without an active exception
Aborted
--
Summary: exception in constructor of a class to be thrown is not
caught
Product: gcc
Version: 3.4.0
Status: UNCONFIRMED
Severity: minor
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: debian-gcc at lists dot debian dot org
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13944