This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: ::delete() reference generated but not used
- From: Gabriel Dos Reis <gdr at integrable-solutions dot net>
- To: Paul Koning <pkoning at equallogic dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: 05 May 2004 17:07:17 +0200
- Subject: Re: ::delete() reference generated but not used
- Organization: Integrable Solutions
- References: <16537.1403.218215.369088@gargle.gargle.HOWL>
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