From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9356 invoked by alias); 6 Feb 2010 12:05:26 -0000 Received: (qmail 9332 invoked by uid 48); 6 Feb 2010 12:05:14 -0000 Date: Sat, 06 Feb 2010 12:05:00 -0000 Message-ID: <20100206120514.9331.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug c++/42983] [c++0x] Unvirtualization of virtual destructor In-Reply-To: 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/msg00459.txt.bz2 ------- Comment #2 from lavock at gmail dot com 2010-02-06 12:05 ------- (In reply to comment #1) > Your testcase doesn't even compile: > > 42983.C: In function ‘int main()’: > 42983.C:15:15: error: cannot convert ‘B’ to ‘A*’ in initialization > Sorry, my mistake, i've added an extra *... #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; } -- lavock at gmail dot com changed: What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |UNCONFIRMED Resolution|INVALID | http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42983