This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Throw & catch bug?


jorgefm@cirsa.com wrote:
> 
> How can the destructor call twice, one after throw (incorrect) and the
> second and ok at the end of the catch.

You forgot to put any instrumentation in the copy constructor. The
compiler is behaving correctly: throwing an exception *always* copies
the object.

--
Ross Smith <ross.s@ihug.co.nz> The Internet Group, Auckland, New Zealand
========================================================================
The good news, according to the FCC, is that television viewing won't be
interrupted by the Y2K problem. The bad news, according to the rest of
us, is that television viewing won't be interrupted by the Y2K problem.
                               -- Jonathan Erickson in Dr Dobb's Journal


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]