This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [c++ PATCH] PR c++/80682
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Ville Voutilainen <ville dot voutilainen at gmail dot com>
- Cc: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>, Jason Merrill <jason at redhat dot com>
- Date: Tue, 9 May 2017 15:25:39 +0200
- Subject: Re: [c++ PATCH] PR c++/80682
- Authentication-results: sourceware.org; auth=none
- Authentication-results: ext-mx10.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com
- Authentication-results: ext-mx10.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=jakub at redhat dot com
- Dkim-filter: OpenDKIM Filter v2.11.0 mx1.redhat.com A5EA4EC2EE
- Dmarc-filter: OpenDMARC Filter v1.3.2 mx1.redhat.com A5EA4EC2EE
- References: <CAFk2RUZMrEwC0c3CzUEscLG8XpSTS9yH69uhujkhyu34_g-ZRw@mail.gmail.com> <alpine.DEB.2.20.1705091508380.2305@stedding.saclay.inria.fr> <CAFk2RUYqW8dfWRzo_MEYaw9fX8X50rj-wj7bLczFgFy++xsREA@mail.gmail.com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Tue, May 09, 2017 at 04:17:07PM +0300, Ville Voutilainen wrote:
> On 9 May 2017 at 16:12, Marc Glisse <marc.glisse@inria.fr> wrote:
> > On Tue, 9 May 2017, Ville Voutilainen wrote:
> >
> >> Tested on Linux-x64, not tested with the full suite yet.
> >>
> >> 2017-05-09 Ville Voutilainen <ville.voutilainen@gmail.com>
> >>
> >> gcc/
> >>
> >> PR c++/80682
> >> * cp/method.c (is_trivially_xible): Reject void types.
No cp/ in cp/ChangeLog entries.
> >> testsuite/
> >>
> >> PR c++/80682
> >> * g++.dg/ext/is_trivially_constructible1.C: Add tests for void target.
> >
> >
> > What happens for "const void" and other variants?
>
>
> They don't work. New patch attached.
> diff --git a/gcc/cp/method.c b/gcc/cp/method.c
> index b4c1f60..9b17ef1 100644
> --- a/gcc/cp/method.c
> +++ b/gcc/cp/method.c
> @@ -1207,6 +1207,8 @@ constructible_expr (tree to, tree from)
> bool
> is_trivially_xible (enum tree_code code, tree to, tree from)
> {
> + if (cv_unqualified (to) == void_type_node)
> + return false;
Can't this be checked more cheaply as if (TYPE_MAIN_VARIANT (to) == void_type_node) ?
Jakub