From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21787 invoked by alias); 14 May 2002 15:46:25 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 21751 invoked by uid 61); 14 May 2002 15:46:23 -0000 Date: Tue, 14 May 2002 08:46:00 -0000 Message-ID: <20020514154623.21750.qmail@sources.redhat.com> To: gcc-bugs@gcc.gnu.org, gcc-prs@gcc.gnu.org, jody@ifi.unizh.ch, nobody@gcc.gnu.org From: lerdsuwa@gcc.gnu.org Reply-To: lerdsuwa@gcc.gnu.org, gcc-bugs@gcc.gnu.org, gcc-prs@gcc.gnu.org, jody@ifi.unizh.ch, nobody@gcc.gnu.org, gcc-gnats@gcc.gnu.org Subject: Re: c++/6006: problem with pure virtual functions and destructord X-SW-Source: 2002-05/txt/msg00396.txt.bz2 List-Id: Synopsis: problem with pure virtual functions and destructord State-Changed-From-To: open->closed State-Changed-By: lerdsuwa State-Changed-When: Tue May 14 08:46:22 2002 State-Changed-Why: Not a bug. The virtual function is treated as non-virtual inside destructors. So ~A() can only call A::f() which is pure virtual. Here is the relevant part of the standard [section 12.7 para 3] ... When a virtual function is called directly or indirectly from a constructor (including from the mem-initializer for a data member) or from a destructor, and the object to which the call applies is the object under construction or destruction, the function called is the one defined in the constructor or destructor's own class or in one of its base, but not a function overriding it in a class derived from the constructor or destructor's class, or overriding it in one of the other base classes of the most derived object (1.8). http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=6006