This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Virtual destructor bug
- To: egcs-bugs at cygnus dot com
- Subject: Virtual destructor bug
- From: David Mazieres <dm at reeducation-labor dot lcs dot mit dot edu>
- Date: Tue, 16 Jun 1998 22:16:56 -0400 (EDT)
The following program (a slight modification of a program to
demonstrate another bug), triggers an entirely different bug in the
latest version of egcs. Adding the firtual destructor causes egcs to
fail with this message:
% c++ -c -O egcs-bug.C
egcs-bug.C:21: sorry, not implemented: `namespace_decl' not supported by dump_type
egcs-bug.C: In instantiation of `ihash<element,1>':
egcs-bug.C:21: instantiated from here
egcs-bug.C:21: conflicting types for `vtable for '
egcs-bug.C:21: previous declaration as `vtable for struct ihash_core<element,1>'
The program compiles with gcc2 and egcs 1.0.3.
Thanks,
David
--
template<class T>
class ihash_entry {
};
template<class T, ihash_entry<T> T::*field>
struct ihash_core {
ihash_core () {}
virtual ~ihash_core () {}
};
template<class T, ihash_entry<T> T::*field>
struct ihash : public ihash_core<T, field>
{
ihash () {}
};
struct element {
ihash_entry<element> hlink;
};
ihash<element, &element::hlink> etab;