This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: [PATCH 3/3] Fix condition for std::variant to be copy constructible
- From: Ville Voutilainen <ville dot voutilainen at gmail dot com>
- To: Jonathan Wakely <jwakely at redhat dot com>
- Cc: "libstdc++" <libstdc++ at gcc dot gnu dot org>, gcc-patches List <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 17 Apr 2019 19:20:22 +0300
- Subject: Re: [PATCH 3/3] Fix condition for std::variant to be copy constructible
- References: <20190417160743.GA31346@redhat.com> <20190417161200.GY943@redhat.com>
On Wed, 17 Apr 2019 at 19:12, Jonathan Wakely <jwakely@redhat.com> wrote:
>
> The standard says the std::variant copy constructor is defined as
> deleted unless all alternative types are copy constructible, but we were
> making it also depend on move constructible. Fix the condition and
> enhance the tests to check the semantics with pathological copy-only
> types (i.e. supporting copying but having deleted moves).
>
> The enhanced tests revealed a regression in copy assignment for
> non-trivial alternative types, where the assignment would not be
> performed because the condition in the _Copy_assign_base visitor is
> false: is_same_v<remove_reference_t<T&>, remove_reference_t<const T&>>.
>
>
> Tested powerpc64le-linux.
>
> I plan to commit all three of these patches later today, unless
> somebody sees a problem with them.
Looks good to me.