This is the mail archive of the gcc-bugs@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]

Re: c++/4861


http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&pr=4861&database=gcc

I've attached an un-preprocessed source file.  Note that this problem 
exists in both 3.0.2 and the current 3.1 snapshot.

Ollie
#include <iostream>

template<class C> class B {
    public:
        ~B()
        {
            std::cerr << "Running B::~B()" << std::endl;
            f();
        }

        virtual void f()
        {
            std::cerr << "Running B::f()" << std::endl;
        }
};

class D : public B<int> {
    public:
        ~D()
        {
            std::cerr << "Running D::~D()" << std::endl;
            f();
        }

        virtual void f()
        {
            std::cerr << "Running D::f()" << std::endl;
        }
};

int main(int argc, char **argv)
{
    D d;

    return 0;
}

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