From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 60368 invoked by alias); 28 Nov 2018 20:36:00 -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 60347 invoked by uid 89); 28 Nov 2018 20:36:00 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=4.9 required=5.0 tests=BAYES_00,GARBLED_SUBJECT,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_LOW autolearn=no version=3.3.2 spammy=25th, H*c:windows-1252, H*r:92.195.153, sk:thread_ X-HELO: mx-relay36-hz1.antispameurope.com Received: from mx-relay36-hz1.antispameurope.com (HELO mx-relay36-hz1.antispameurope.com) (94.100.133.212) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 28 Nov 2018 20:35:57 +0000 Return-Path: Received: from s041.bre.qsc.de ([195.90.7.81]) by mx-relay36-hz1.antispameurope.com; Wed, 28 Nov 2018 21:35:55 +0100 Received: from tux.net-b.de (port-92-195-153-136.dynamic.qsc.de [92.195.153.136]) by s041.bre.qsc.de (Postfix) with ESMTPSA id 2D5122C02FA; Wed, 28 Nov 2018 21:35:53 +0100 (CET) Subject: =?UTF-8?Q?Re=3a_*ping*=5e2_=e2=80=93_PR_C++/88114_-_PATCH_for_destr?= =?UTF-8?Q?uctor_not_generated_for_=22virtual_=7edestructor=28=29_=3d_defaul?= =?UTF-8?Q?t=22?= From: Tobias Burnus To: Tobias Burnus , gcc-patches@gcc.gnu.org References: <20181121121935.tm4y2wyie6bc72sn@physik.fu-berlin.de> <7aa0a107-0595-adc1-9cce-d41b953846e3@net-b.de> Message-ID: Date: Wed, 28 Nov 2018 20:36:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.3.1 MIME-Version: 1.0 In-Reply-To: <7aa0a107-0595-adc1-9cce-d41b953846e3@net-b.de> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit X-cloud-security-sender:burnus@net-b.de X-cloud-security-recipient:gcc-patches@gcc.gnu.org X-cloud-security-Virusscan:CLEAN X-cloud-security-disclaimer: This E-Mail was scanned by E-Mailservice on mx-relay36-hz1.antispameurope.com with A15438A0890 X-cloud-security-connect: s041.bre.qsc.de[195.90.7.81], TLS=1, IP=195.90.7.81 X-cloud-security:scantime:.2467 X-SW-Source: 2018-11/txt/msg02358.txt.bz2 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