From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id D38263858C2F; Sun, 24 Dec 2023 15:12:31 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D38263858C2F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1703430751; bh=75BXux1AlToewNXkAAvTYswNjXxkINc0DsN+vf8ne/o=; h=From:To:Subject:Date:In-Reply-To:References:From; b=GX/iNI4HJL11uM/7D9zEWbcF7eUdyF2x7lc6A69vexQ7cD4TPmsMSF/OJAoVrxSza pNMg/xXHePEE2cfPDhHaosUtQae24uMuPV+wUwX3T5F2h1RJbAb6BIM6VEv7bP8mmR 9wiwJM5hIi2Oo6Nr++HBeGSVwU/vpUaRq/Pc8LpM= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/111485] [11/12 Regression] Constraint mismatch on template template parameter Date: Sun, 24 Dec 2023 15:12:31 +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 #5 from GCC Commits --- The releases/gcc-11 branch has been updated by Patrick Palka : https://gcc.gnu.org/g:84cab505d69038647d98f9340559fc941446e479 commit r11-11168-g84cab505d69038647d98f9340559fc941446e479 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.c (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)=