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++/103198] ICE for requires requires clause with varadic templates Date: Fri, 19 Nov 2021 00:32:46 +0000 [thread overview] Message-ID: <bug-103198-4-IbI9HHCfYK@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-103198-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103198 --- Comment #4 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:09c24fe42ff2cef3f3291f5a7540a5835c08430c commit r12-5389-g09c24fe42ff2cef3f3291f5a7540a5835c08430c Author: Patrick Palka <ppalka@redhat.com> Date: Thu Nov 18 19:32:22 2021 -0500 c++: implicit dummy object in requires clause [PR103198] In the testcase below satisfaction misbehaves for f and g ultimately because find_template_parameters fails to notice that the constraint 'val.x' depends on the template parms of the class template. In contrast, satisfaction works just fine for h. The problem seems to come down to a difference in how any_template_parm_r handles 'this' vs a dummy object: it walks the TREE_TYPE of the former but not the latter, and this causes us to miss the tparm dependencies in f/g's constraints since in their case the implicit object parm through which we access 'val' is a dummy object. (For h, since we know it's a non-static member function when parsing its trailing constraints, the implicit object parm is 'this', not a dummy object.) This patch fixes this inconsistency by making any_template_parm_r walk into the TREE_TYPE of a dummy object, like it already does for 'this'. PR c++/103198 gcc/cp/ChangeLog: * pt.c (any_template_parm_r): Walk the TREE_TYPE of a dummy object. gcc/testsuite/ChangeLog: * g++.dg/cpp2a/concepts-this1.C: New test.
next prev parent reply other threads:[~2021-11-19 0:32 UTC|newest] Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top 2021-11-11 18:38 [Bug c++/103198] New: " unlvsur at live dot com 2021-11-11 18:39 ` [Bug c++/103198] " unlvsur at live dot com 2021-11-11 18:40 ` unlvsur at live dot com 2021-11-11 19:46 ` ppalka at gcc dot gnu.org 2021-11-19 0:32 ` cvs-commit at gcc dot gnu.org [this message] 2021-12-15 19:55 ` cvs-commit at gcc dot gnu.org 2021-12-15 19:58 ` 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-103198-4-IbI9HHCfYK@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).