From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6336 invoked by alias); 6 Feb 2010 07:58:24 -0000 Received: (qmail 6310 invoked by uid 48); 6 Feb 2010 07:58:13 -0000 Date: Sat, 06 Feb 2010 07:58:00 -0000 Subject: [Bug c++/42983] New: [c++0x] Unvirtualzation of virtual destructor X-Bugzilla-Reason: CC Message-ID: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "lavock at gmail dot com" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2010-02/txt/msg00452.txt.bz2 Hello, The way to declare a inline virtual destructor within the class declaration seems to unvirtualize it. Trying the following code : #include struct A { virtual ~A() = default; }; struct B : A { virtual ~B() { std::cout << "B destructor" << std::endl; } }; int main() { B* b = new B; A * ptrA = *b; delete ptrA; return 0; } Nothing appear on standard output. -- Summary: [c++0x] Unvirtualzation of virtual destructor Product: gcc Version: 4.4.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: lavock at gmail dot com GCC build triplet: -486-linux-gnu GCC host triplet: -486-linux-gnu GCC target triplet: -i486-linux-gnu http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42983