virtual destructor unexpected pass

Todd Vierling tv@pobox.com
Tue Sep 1 17:00:00 GMT 1998


Here's a short example of something odd I ran into on egcs-1.1-prerelease.
It causes a link error that ~A() is undefined; I believe that the destructor
in A below is an error and there should be a compiler error instead.

As you see, ~A() is virtual and overloaded, but it doesn't exist to destruct
itself in the derived class B.

=====

class A {
public:
        virtual ~A() = 0;
};

class B : public A {
public:
        ~B() {}
};

int main(void) {
        B b;
}

-- 
-- Todd Vierling (Personal tv@pobox.com; Bus. todd_vierling@xn.xerox.com)




More information about the Gcc-bugs mailing list