public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "ville.voutilainen at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
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 [thread overview]
Message-ID: <bug-95915-4@http.gcc.gnu.org/bugzilla/> (raw)
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95915
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 <variant>
struct X {
virtual ~X() = default;
};
int main() {
std::variant<X> 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.
next reply other threads:[~2020-06-26 14:40 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-26 14:40 ville.voutilainen at gmail dot com [this message]
2020-06-26 14:41 ` [Bug libstdc++/95915] " ville.voutilainen at gmail dot com
2020-06-26 18:19 ` [Bug libstdc++/95915] [10/11 Regression] " redi at gcc dot gnu.org
2020-06-27 18:06 ` ville.voutilainen at gmail dot com
2020-06-28 21:37 ` cvs-commit at gcc dot gnu.org
2020-06-29 11:04 ` cvs-commit at gcc dot gnu.org
2020-06-29 11:05 ` ville.voutilainen at gmail dot com
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=bug-95915-4@http.gcc.gnu.org/bugzilla/ \
--to=gcc-bugzilla@gcc.gnu.org \
--cc=gcc-bugs@gcc.gnu.org \
/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).