X-pop3-spooler: POP3MAIL 2.1.0 b 4 980420 -bs- Message-ID: <19980812161504.A23422@amdiv.de> Date: Wed, 12 Aug 1998 16:15:04 +0200 From: Felix von Leitner To: Pentium GCC Subject: Is this a bug? Mail-Followup-To: Pentium GCC Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.94.1i Sender: Marc Lehmann Status: RO Content-Length: 526 Lines: 36 If I execute this code, to my understanding foo::bug should never be called, since it is a virtual function. Felix #include class foo { public: foo() { } virtual void bug() { puts("why am I being called?"); } ~foo() { puts("start of foo::~foo"); bug(); } }; class bar : public foo { public: bar() : foo() { } virtual void bug() { puts("bug not there"); } ~bar() { bug(); // should not be calling bar::bug puts("end of bar::~bar"); } }; main() { class bar temp; }