g++ generates code for constructors and destructors several times

2010-05-19 Thread Lénaïc Huard
Hello, I have a question about code generated by g++. When compiling a C++ class, even as simple as the one below, the code for the constructor is instantiated twice and the code for the destructor is instanciated twice or three times. = myclass.cpp = class MyClass { MyClass();

Re: g++ generates code for constructors and destructors several times

2010-05-19 Thread Andrew Pinski
On Wed, May 19, 2010 at 9:17 AM, Lénaïc Huard lenaic.hu...@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