Virtual destructor bug

David Mazieres dm@reeducation-labor.lcs.mit.edu
Tue Jun 16 19:17:00 GMT 1998


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;



More information about the Gcc-bugs mailing list