This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
RE: Great g++ bug! Local destructor isn't called!
- From: "Assinovsky, Lev" <LAssinovsky at algorithm dot aelita dot com>
- To: "Eljay Love-Jensen" <eljay at adobe dot com>,<gcc-help at gcc dot gnu dot org>
- Date: Thu, 11 Mar 2004 13:42:40 +0300
- Subject: RE: Great g++ bug! Local destructor isn't called!
If to compile with -fno-enforce-eh-specs my testcase works.
Actually that's very natural. The bug is shown up if
an exception spec of exception raiser exactly matches
an exception spec of the virtual function.
----
Lev Assinovsky
Aelita Software Corporation
O&S InTrust Framework Division, Team Leader
ICQ# 165072909
> -----Original Message-----
> From: Eljay Love-Jensen [mailto:eljay@adobe.com]
> Sent: Wednesday, March 10, 2004 5:46 PM
> To: Assinovsky, Lev; gcc-help@gcc.gnu.org
> Subject: Re: Great g++ bug! Local destructor isn't called!
>
>
> Hi Lev,
>
> I notice that if the throw(int) specification is taken off the Raiser
> constructor, then the ~Object() is called with -O3.
>
> (I'm using GCC 3.3.1 on CygWin / Windows XP.)
>
> Very odd. Good catch. Have you filed a bug?
>
> BTW, in general, I've found that it's usually best NOT to put
> in throw
> specifications for functions / methods. Ever. (This
> restriction does not
> apply to putting in the "throw() -- I throw nothing, ever"
> specification. But even that should be used with great caution.)
>
> If C++ did exception specifications like how Java does them,
> then that'd be
> a different story.
>
> --Eljay
>
>