This is the mail archive of the gcc@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]
Other format: [Raw text]

Re: ::delete() reference generated but not used


Paul Koning <pkoning@equallogic.com> writes:

[...]

| class B
| {
| public:
| 	virtual ~B(void) {}
| 
| 	virtual void hello(void) = 0;

[...]

| However, even though B is only a base class, it seems that gcc is
| still generating in-charge destructors for B.  As a result, we end up
| with references in the object file to ::delete() which means we get
| link errors because that operator isn't defined anywhere.

Your analyzis is correct.  I believe that the reference to 
::operator delete is an artifact of GCC emitting a deleting destructor
for B. I would say that that is a mandated behaviour of the ABI
(although I don't have the document at hand in order to check).
I don't know if the linker can safely remove that unused destructor
given dynamic linking...

-- Gaby


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