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++/97103] [10 Regression] ICE on nested requires expression template template instantiation Date: Wed, 31 Mar 2021 12:33:37 +0000 [thread overview] Message-ID: <bug-97103-4-NCdsd731D9@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-97103-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97103 --- Comment #6 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-10 branch has been updated by Patrick Palka <ppalka@gcc.gnu.org>: https://gcc.gnu.org/g:a834e6d59d74ccaefbcbbed5ea7ee25305057853 commit r10-9634-ga834e6d59d74ccaefbcbbed5ea7ee25305057853 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. (cherry picked from commit e5d72c840a226fdbab65912f97d42a1dbdaf6ed2)
next prev parent reply other threads:[~2021-03-31 12:33 UTC|newest] Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top 2020-09-18 9:45 [Bug c++/97103] New: " mateusz.pusz at gmail dot com 2020-09-18 9:45 ` [Bug c++/97103] " mateusz.pusz at gmail dot com 2020-09-18 12:55 ` ppalka at gcc dot gnu.org 2020-09-18 18:47 ` [Bug c++/97103] [10/11 Regression] " ppalka at gcc dot gnu.org 2020-09-19 15:18 ` cvs-commit at gcc dot gnu.org 2020-10-12 11:52 ` [Bug c++/97103] [10 " rguenth at gcc dot gnu.org 2021-03-31 12:33 ` cvs-commit at gcc dot gnu.org [this message] 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-97103-4-NCdsd731D9@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: linkBe 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).