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
* [Bug libstdc++/95915] std::variant doesn't like types with a defaulted virtual destructor
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 ` ville.voutilainen at gmail dot com
2020-06-26 18:19 ` [Bug libstdc++/95915] [10/11 Regression] " redi at gcc dot gnu.org
` (4 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: ville.voutilainen at gmail dot com @ 2020-06-26 14:41 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95915
Ville Voutilainen <ville.voutilainen at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Ever confirmed|0 |1
Last reconfirmed| |2020-06-26
Status|UNCONFIRMED |ASSIGNED
Assignee|unassigned at gcc dot gnu.org |ville.voutilainen at gmail dot com
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug libstdc++/95915] [10/11 Regression] std::variant doesn't like types with a defaulted virtual destructor
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 ` redi at gcc dot gnu.org
2020-06-27 18:06 ` ville.voutilainen at gmail dot com
` (3 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: redi at gcc dot gnu.org @ 2020-06-26 18:19 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95915
Jonathan Wakely <redi at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Summary|std::variant doesn't like |[10/11 Regression]
|types with a defaulted |std::variant doesn't like
|virtual destructor |types with a defaulted
| |virtual destructor
Known to work| |9.3.0
Keywords| |rejects-valid
Target Milestone|--- |10.2
Known to fail| |10.1.0, 11.0
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug libstdc++/95915] [10/11 Regression] std::variant doesn't like types with a defaulted virtual destructor
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
` (2 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: ville.voutilainen at gmail dot com @ 2020-06-27 18:06 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95915
--- Comment #1 from Ville Voutilainen <ville.voutilainen at gmail dot com> ---
Patch at https://gcc.gnu.org/pipermail/gcc-patches/2020-June/549030.html
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug libstdc++/95915] [10/11 Regression] std::variant doesn't like types with a defaulted virtual destructor
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
` (2 preceding siblings ...)
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
5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-06-28 21:37 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95915
--- Comment #2 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Ville Voutilainen <ville@gcc.gnu.org>:
https://gcc.gnu.org/g:24b54628cfa95194a8de4071c28cb56e6e81c08e
commit r11-1698-g24b54628cfa95194a8de4071c28cb56e6e81c08e
Author: Ville Voutilainen <ville.voutilainen@gmail.com>
Date: Mon Jun 29 00:36:38 2020 +0300
PR libstdc++/95915
PR libstdc++/95915
* include/std/type_traits (is_literal_type, is_literal_type_v):
Deprecate in C++17.
* include/std/variant (_Uninitialized):
Adjust the condition and the comment.
* testsuite/20_util/is_literal_type/deprecated-1z.cc: New.
*
testsuite/20_util/is_literal_type/requirements/explicit_instantiation.cc:
Adjust.
* testsuite/20_util/is_literal_type/requirements/typedefs.cc:
Likewise.
* testsuite/20_util/is_literal_type/value.cc: Likewise.
* testsuite/20_util/optional/constexpr/nullopt.cc:
Use __is_literal_type directly.
* testsuite/20_util/optional/nullopt.cc: Likewise.
* testsuite/20_util/variable_templates_for_traits.cc: Adjust.
* testsuite/20_util/variant/95915.cc: New.
* testsuite/20_util/variant/compile.cc: Add new test.
* testsuite/experimental/optional/constexpr/nullopt.cc:
Use __is_literal_type directly.
* testsuite/experimental/optional/nullopt.cc: Likewise.
* testsuite/experimental/type_traits/value.cc: Adjust.
* testsuite/util/testsuite_common_types.h:
Use __is_literal_type directly.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug libstdc++/95915] [10/11 Regression] std::variant doesn't like types with a defaulted virtual destructor
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
` (3 preceding siblings ...)
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
5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-06-29 11:04 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95915
--- Comment #3 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-10 branch has been updated by Ville Voutilainen
<ville@gcc.gnu.org>:
https://gcc.gnu.org/g:deb9c51ca71d3cb507dd91ab8bfd8c1021effd9f
commit r10-8386-gdeb9c51ca71d3cb507dd91ab8bfd8c1021effd9f
Author: Ville Voutilainen <ville.voutilainen@gmail.com>
Date: Mon Jun 29 00:36:38 2020 +0300
PR libstdc++/95915
PR libstdc++/95915
* include/std/variant (_Uninitialized):
Adjust the condition and the comment.
* testsuite/20_util/variant/95915.cc: New.
* testsuite/20_util/variant/compile.cc: Add new test.
(cherry picked from commit 24b54628cfa95194a8de4071c28cb56e6e81c08e)
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug libstdc++/95915] [10/11 Regression] std::variant doesn't like types with a defaulted virtual destructor
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
` (4 preceding siblings ...)
2020-06-29 11:04 ` cvs-commit at gcc dot gnu.org
@ 2020-06-29 11:05 ` ville.voutilainen at gmail dot com
5 siblings, 0 replies; 7+ messages in thread
From: ville.voutilainen at gmail dot com @ 2020-06-29 11:05 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95915
Ville Voutilainen <ville.voutilainen at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Resolution|--- |FIXED
Status|ASSIGNED |RESOLVED
--- Comment #4 from Ville Voutilainen <ville.voutilainen at gmail dot com> ---
Fixed.
^ 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).