This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: c++/3282: Problems with throw and destuctor callings
- To: "Bohdan Vlasyuk" <bohdan at kivc dot vstu dot vinnica dot ua>
- Subject: Re: c++/3282: Problems with throw and destuctor callings
- From: "Artem Khodush" <artem at duma dot gov dot ru>
- Date: Thu, 21 Jun 2001 13:00:03 +0400
- >Received: from artem by mailsrv.duma.gov.ru (SMI-8.6/SMI-SVR4)id NAA13291; Thu, 21 Jun 2001 13:03:08 +0400
- Cc: <gcc-gnats at gcc dot gnu dot org>, <gcc-bugs at gcc dot gnu dot org>
- References: <200106200817.f5K8Hi205241@kivc.vstu.vinnica.ua>
>
> #include <iostream.h>
> int global;
>
> class One {
> public:
> int num;
> One() { num=++global; cout << "One " <<num<<endl; };
> void Copy(One second_one) { cout << "Copy " <<num<<endl; };
> ~One() { cout << "~One "<<num<<endl; };
> };
>
This is not a bug. Define copy constructor for class One, like
One( const One& ) { num=++global; cout<<"One copy constructor"<<num<<endl; }
and see if it helps.