]> git.ipfire.org Git - thirdparty/gcc.git/commit
libstdc++: Fix constraints for std::variant default constructor
authorJonathan Wakely <jwakely@redhat.com>
Thu, 14 Sep 2023 09:27:09 +0000 (10:27 +0100)
committerJonathan Wakely <jwakely@redhat.com>
Fri, 15 Sep 2023 09:24:01 +0000 (10:24 +0100)
commit5daeda573cedc2910ecee7f1b3168210143dc026
tree8d37d1acaca91dc735fe416371df021128e0f0c1
parentd19bdf8874059457fdfe50a9e14dad8f8b8cecbb
libstdc++: Fix constraints for std::variant default constructor

The standard says the default ctor should be constrained, not deleted.
Our use of a defaulted default ctor and _Enable_default_constructor base
class results in it being deleted.

libstdc++-v3/ChangeLog:

* include/std/variant (variant): Remove derivation from
_Enable_default_constructor base class.
(variant::variant()): Constrain.
* testsuite/20_util/variant/default_ctor.cc: New test.
libstdc++-v3/include/std/variant
libstdc++-v3/testsuite/20_util/variant/default_ctor.cc [new file with mode: 0644]