This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: g++ generates code for constructors and destructors several times
- From: Andrew Pinski <pinskia at gmail dot com>
- To: LÃnaÃc Huard <lenaic dot huard at laposte dot net>
- Cc: gcc at gcc dot gnu dot org
- Date: Wed, 19 May 2010 09:27:54 -0700
- Subject: Re: g++ generates code for constructors and destructors several times
- References: <201005191817.23456.lenaic.huard@laposte.net>
On Wed, May 19, 2010 at 9:17 AM, LÃnaÃc Huard <lenaic.huard@laposte.net> wrote:
> If I remove the virtual keyword to make the class non-polymorphic, the
> constructor is still compiled twice, as well as the destructor.
>
> Would anyone have the patience to explain me why the constructors/destructors
> are compiled several times ?
See http://gcc.gnu.org/bugzilla/show_bug.cgi?id=3187. Note 4.5 has
improved this situation for many targets so you might want to try that
version of GCC.
Thanks,
Andrew Pinski