From: Tobias Burnus <burnus@net-b.de>
To: Tobias Burnus <tobias.burnus@physik.fu-berlin.de>,
gcc-patches@gcc.gnu.org
Subject: Re: *ping*^2 – PR C++/88114 - PATCH for destructor not generated for "virtual ~destructor() = default"
Date: Wed, 28 Nov 2018 20:36:00 -0000 [thread overview]
Message-ID: <bdc1d7be-41cf-dc44-f226-692649ea0dec@net-b.de> (raw)
In-Reply-To: <7aa0a107-0595-adc1-9cce-d41b953846e3@net-b.de>
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
next prev parent reply other threads:[~2018-11-28 20:36 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-21 12:19 PR C++/88114 - patch " Tobias Burnus
2018-11-25 8:44 ` *ping* – PR C++/88114 - PATCH " Tobias Burnus
2018-11-28 20:36 ` Tobias Burnus [this message]
2018-12-04 12:42 ` *PING*^3 [C++ Patch] " Tobias Burnus
2018-12-05 22:50 ` PR C++/88114 - patch " Jason Merrill
2019-01-11 18:36 ` Tobias Burnus
2019-01-11 18:57 ` Jason Merrill
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=bdc1d7be-41cf-dc44-f226-692649ea0dec@net-b.de \
--to=burnus@net-b.de \
--cc=gcc-patches@gcc.gnu.org \
--cc=tobias.burnus@physik.fu-berlin.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).