From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 33040 invoked by alias); 4 Dec 2018 12:42:18 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 33026 invoked by uid 89); 4 Dec 2018 12:42:18 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: Yes, score=5.6 required=5.0 tests=BAYES_00,GARBLED_SUBJECT,KAM_LAZY_DOMAIN_SECURITY autolearn=no version=3.3.2 spammy=sk:decl_de, 25th, HContent-Transfer-Encoding:8bit X-HELO: outpost19.zedat.fu-berlin.de Received: from outpost19.zedat.fu-berlin.de (HELO outpost19.zedat.fu-berlin.de) (130.133.4.112) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 04 Dec 2018 12:42:15 +0000 Received: from relay1.zedat.fu-berlin.de ([130.133.4.67]) by outpost.zedat.fu-berlin.de (Exim 4.85) with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (envelope-from ) id <1gUA1l-001VL5-A1>; Tue, 04 Dec 2018 13:42:13 +0100 Received: from mx.physik.fu-berlin.de ([160.45.64.218]) by relay1.zedat.fu-berlin.de (Exim 4.85) with esmtps (TLSv1.2:DHE-RSA-AES128-SHA:128) (envelope-from ) id <1gUA1l-000kyx-7R>; Tue, 04 Dec 2018 13:42:13 +0100 Received: from login1.physik.fu-berlin.de ([160.45.66.207]) by mx.physik.fu-berlin.de with esmtps (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.80) (envelope-from ) id 1gUA1h-0000eG-WA; Tue, 04 Dec 2018 13:42:10 +0100 Received: from tburnus by login1.physik.fu-berlin.de with local (Exim 4.89 #2 (Debian)) id 1gUA1h-0004lM-Uy; Tue, 04 Dec 2018 13:42:09 +0100 Date: Tue, 04 Dec 2018 12:42:00 -0000 From: Tobias Burnus To: Tobias Burnus Cc: gcc-patches@gcc.gnu.org Subject: *PING*^3 [C++ Patch] =?utf-8?B?4oCTIFBS?= =?utf-8?Q?_C++=2F88114_-_PATCH_for_destructo?= =?utf-8?Q?r?= not generated for "virtual ~destructor() = default" Message-ID: <20181204124209.pwk6qktb5ylb7wnj@physik.fu-berlin.de> References: <20181121121935.tm4y2wyie6bc72sn@physik.fu-berlin.de> <7aa0a107-0595-adc1-9cce-d41b953846e3@net-b.de> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: NeoMutt/20170113 (1.7.2) Sender: Tobias Burnus X-SW-Source: 2018-12/txt/msg00164.txt.bz2 On Wed, Nov 28, 2018 at 09:35:53PM +0100, Tobias Burnus wrote: > On the 25th November 2018, schrieb Tobias Burnus wrote: > > On 21 November 2018, Tobias Burnus wrote: > > > Hello all, > > > > > > if a class contains any 'virtual ... = 0', it's an abstract class > > > and for an > > > abstract class, the destructor not added to the vtable. > > > > > > For a normal > > >    virtual ~class() { } > > > that's not a problem as the class::~class() destructor will be > > > generated during > > > the parsing of the function. > > > > > > But for > > >    virtual ~class() = default; > > > the destructor will be generated via mark_used via the vtable. > > > > > > > > > If one now declares a derived class and uses it, the class::~class() > > > is generated > > > in that translation unit.  Unless, #pragma interface/implementation > > > is used. > > > > > > In that case, the 'default' destructor will never be generated. > > > > > > > > > The following code seems to work both for the big code and for the > > > example; > > > without '#pragma implementation', the destructor is not generated > > > for the example, > > > only with. > > > > > > The patch survived boostrapping GCC with default languages on > > > x86-64-gnu-linux > > > and "make check-g++".* > > > > > > [One probably could get rid of some of the conditions for generating > > > the code, > > > e.g. TREE_USED and DECL_DEFAULTED_FN are probably not both needed; > > > one might > > > want to set some additional DECL to the fn decl.] > > > > > > Does the patch and the test case make sense? Or is something else/in > > > addition > > > needed? > > > > > > Tobias > > > > > > > > > *I do get the following failures on this CentOS6 system: > > > > > > FAIL: g++.dg/pr83239.C  -std=gnu++98 (test for excess errors) > > > Excess errors: > > > cc1plus: warning: 'void* __builtin_memset(void*, int, long unsigned > > > int)' specified size 18446744073709551608 exceeds maximum object > > > size 9223372036854775807 [-Wstringop-overflow=] > > > cc1plus: warning: 'void* __builtin_memset(void*, int, long unsigned > > > int)' specified size 18446744073709551600 exceeds maximum object > > > size 9223372036854775807 [-Wstringop-overflow=] > > > > > > FAIL: g++.dg/tls/thread_local-order2.C  -std=c++14 execution test > > > FAIL: g++.dg/tls/thread_local-order2.C  -std=c++17 execution test > > > > > > plus each 32 times: > > > FAIL: guality/guality.h: 0 PASS, 1 FAIL, 0 UNRESOLVED > > > FAIL: guality/guality.h: varl is -1, not 6