From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 393993857009; Sun, 24 Sep 2023 18:42:51 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 393993857009 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1695580971; bh=sB2dy4D938P7aly9S5jwr24pb3LWKqBX2iFZwEe6Bto=; h=From:To:Subject:Date:In-Reply-To:References:From; b=YLGIg0rWyJaBJHJD42d7oQzerrmZzjp4ey0FNEGAkZL6Y3YY2zPnt7cu8t8nIyORP uBunDgrGoGxg1L1bXaha8V/NBz5lFuyBAwLdA0J9E/90uYUGs5YxxAQvirDbczR9zD eKkRziKPVfrm4Au02oyn0jxSj/FnekTervxfJQLM= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/111485] [11/12/13/14 Regression] Constraint mismatch on template template parameter Date: Sun, 24 Sep 2023 18:42:50 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 13.1.0 X-Bugzilla-Keywords: rejects-valid X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: ppalka at gcc dot gnu.org X-Bugzilla-Target-Milestone: 11.5 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D111485 --- Comment #3 from CVS Commits --- The releases/gcc-13 branch has been updated by Patrick Palka : https://gcc.gnu.org/g:59f5786c20a42be13ac6fec567ffe840045012ad commit r13-7836-g59f5786c20a42be13ac6fec567ffe840045012ad Author: Patrick Palka Date: Fri Sep 22 06:25:49 2023 -0400 c++: constraint rewriting during ttp coercion [PR111485] In order to compare the constraints of a ttp with that of its argument, we rewrite the ttp's constraints in terms of the argument template's template parameters. The substitution to achieve this currently uses a single level of template arguments, but that never does the right thing because a ttp's template parameters always have level >=3D 2. This pat= ch fixes this by including the outer template arguments in the substitutio= n, which ought to match the depth of the ttp. The second testcase demonstrates it's better to substitute the concrete outer template arguments instead of generic ones since a ttp's constrai= nts could depend on outer parameters. PR c++/111485 gcc/cp/ChangeLog: * pt.cc (is_compatible_template_arg): New parameter 'args'. Add the outer template arguments 'args' to 'new_args'. (convert_template_argument): Pass 'args' to is_compatible_template_arg. gcc/testsuite/ChangeLog: * g++.dg/cpp2a/concepts-ttp5.C: New test. * g++.dg/cpp2a/concepts-ttp6.C: New test. (cherry picked from commit 6f902a42b0afe3f3145bcb864695fc290b5acc3e)=