From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 16720385DC35; Fri, 26 Jun 2020 14:40:54 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 16720385DC35 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1593182454; bh=8Wcgfy08i2yvji1/OQ3YccbNThwd9N/ZTBwk6ZVmfQU=; h=From:To:Subject:Date:From; b=Aadx05gMGKFgBzJhJiFAV8FpP6HAVvduD//pc8BIs5dgKi3xuwTHNl7e3k0M9V2C5 N2g+X5YNXswFl81eJxZW/f5I+BEFpue0bEWaLUTgiizShHTlCql9cTFeQ7bM4NshUI 4PFogOAaYI3fSecGOIIHFLzqJ6+QM2q/i43T7Wro= From: "ville.voutilainen at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/95915] New: std::variant doesn't like types with a defaulted virtual destructor Date: Fri, 26 Jun 2020 14:40:53 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libstdc++ X-Bugzilla-Version: 11.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: ville.voutilainen at gmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Jun 2020 14:40:54 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D95915 Bug ID: 95915 Summary: std::variant doesn't like types with a defaulted virtual destructor Product: gcc Version: 11.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: libstdc++ Assignee: unassigned at gcc dot gnu.org Reporter: ville.voutilainen at gmail dot com Target Milestone: --- >>From Patrice Roy: The following code compiled in C++17 but seems broken in C++20, at least according the Clang and gcc: #include struct X { virtual ~X() =3D default; }; int main() { std::variant v; } This is because variant's storage uses an _Uninitialized type that hacks around a compiler bug, where the type X above wasn't literal. Now that it is, the hack breaks. Since variant's other base-layers handle triviality of special member functions properly, this hack can now be removed.=