public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/95915] New: std::variant doesn't like types with a defaulted virtual destructor
@ 2020-06-26 14:40 ville.voutilainen at gmail dot com
  2020-06-26 14:41 ` [Bug libstdc++/95915] " ville.voutilainen at gmail dot com
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: ville.voutilainen at gmail dot com @ 2020-06-26 14:40 UTC (permalink / raw)
  To: gcc-bugs

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.

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2020-06-29 11:05 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-26 14:40 [Bug libstdc++/95915] New: std::variant doesn't like types with a defaulted virtual destructor ville.voutilainen at gmail dot com
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

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).