This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
c++/2373: Exception rethrow in function-try-block
- To: gcc-gnats at gcc dot gnu dot org
- Subject: c++/2373: Exception rethrow in function-try-block
- From: Frank dot Uepping at epost dot de
- Date: 24 Mar 2001 11:48:54 -0000
- Reply-To: Frank dot Uepping at epost dot de
>Number: 2373
>Category: c++
>Synopsis: Exception rethrow in function-try-block
>Confidential: no
>Severity: critical
>Priority: medium
>Responsible: unassigned
>State: open
>Class: wrong-code
>Submitter-Id: net
>Arrival-Date: Sat Mar 24 03:56:01 PST 2001
>Closed-Date:
>Last-Modified:
>Originator: Frank Uepping
>Release: gcc version 2.95.2 19991024 (release)
>Organization:
>Environment:
FreeBSD 4.1-RELEASE
>Description:
#include <iostream>
// ISO-IEC-14882 stated in §15.3-16: The exception being handled is rethrown
// if control reaches the end of a handler of the function-try-block of
// a constructor or destructor.
class X
{
public:
X ()
try
{
throw int ();
}
catch (...)
{
// No rethrow! Violates with ISO-IEC-14882 §15.3-16.
// Same happens for destructor.
}
};
int main ()
try
{
X x;
}
catch (...)
{
std::cerr << "catched exception\n";
}
>How-To-Repeat:
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted: