public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "cvs-commit at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/96531] [10/11 Regression] ICE for concepts here.
Date: Sat, 19 Sep 2020 15:18:30 +0000	[thread overview]
Message-ID: <bug-96531-4-0lNYOaMlih@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-96531-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96531

--- Comment #2 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Patrick Palka <ppalka@gcc.gnu.org>:

https://gcc.gnu.org/g:e5d72c840a226fdbab65912f97d42a1dbdaf6ed2

commit r11-3296-ge5d72c840a226fdbab65912f97d42a1dbdaf6ed2
Author: Patrick Palka <ppalka@redhat.com>
Date:   Sat Sep 19 11:02:46 2020 -0400

    c++: Fix self-mapping in map_arguments [PR96531, PR97103]

    With r10-8077 we stopped passing the argified current_template_parms to
    normalize_constraint_expression from finish_nested_requirement, and
    instead made map_arguments perform a self-mapping of parameters when
    args is NULL.  But we're currently not handling parameter packs and
    BOUND_TEMPLATE_TEMPLATE_PARMs properly during this self-mapping, which
    leads to ICEs later during satisfaction.

    To properly handle self-mapping of a parameter pack, this patch
    extends template_parm_to_arg to handle TEMPLATE_PARM_P nodes, and
    makes map_arguments use it.  (This change revealed that the call to
    template_parm_to_arg in convert_generic_types_to_packs was a no-op
    because the argument 't' is never a TREE_LIST, so this patch
    additionally removes this call.)

    As for bound ttps, map_arguments before r10-8077 would map a
    BOUND_TEMPLATE_TEMPLATE_PARM not to itself but to its underlying
    TEMPLATE_TEMPLATE_PARM.  We could restore this behavior in
    map_arguments, but since a bound ttp is not really a template parameter
    it seems better to make keep_template_parm not give us a bound ttp in
    the first place.  So this patch makes keep_template_parm return the
    underlying ttp when it sees a bound ttp.

    gcc/cp/ChangeLog:

            PR c++/96531
            PR c++/97103
            * constraint.cc (map_arguments): Call template_parm_to_arg
            in the self-mapping case.
            (finish_shorthand_constraint): No need to build a TREE_LIST
            before calling template_parm_to_arg.
            * pt.c (template_parm_to_arg): Rewrite to handle TEMPLATE_PARM_P
            nodes as well as DECL_TEMPLATE_PARM_P nodes, and to make the
            overlying TREE_LIST node optional.
            (keep_template_parm): Don't record a BOUND_TEMPLATE_TEMPLATE_PARM,
            instead record its corresponding TEMPLATE_TEMPLATE_PARM.
            (convert_generic_types_to_packs): Don't call
            template_parm_to_arg.

    gcc/testsuite/ChangeLog:

            PR c++/96531
            PR c++/97103
            * g++.dg/cpp2a/concepts-ttp2.C: New test.
            * g++.dg/cpp2a/concepts-variadic1.C: New test.

  parent reply	other threads:[~2020-09-19 15:18 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-07 22:38 [Bug c++/96531] New: " euloanty at live dot com
2020-08-12 12:57 ` [Bug c++/96531] [10/11 Regression] " ppalka at gcc dot gnu.org
2020-09-18 18:50 ` ppalka at gcc dot gnu.org
2020-09-19 15:18 ` cvs-commit at gcc dot gnu.org [this message]
2020-10-07 18:55 ` ppalka at gcc dot gnu.org
2020-10-12 12:36 ` [Bug c++/96531] [10 " rguenth at gcc dot gnu.org
2021-03-31 12:33 ` cvs-commit at gcc dot gnu.org
2021-03-31 12:35 ` ppalka at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-96531-4-0lNYOaMlih@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).