From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id E835B388F061; Thu, 4 Jun 2020 17:21:30 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E835B388F061 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1591291290; bh=nTa7O8xRfrWa3zLRC56exocswI9NKTDjXIqB4lVvmHs=; h=From:To:Subject:Date:In-Reply-To:References:From; b=uK1QxVGGK3ZtjG7ioXVU6TW2yA/lVT7rDNgDlyHXWgDwt+pE9PfdWQBzHB5x7peKh M9RgzImNUsPorMXQYkM0egk4Joqjwjl19JNR18hWKR6bSsQfLTdyFLsHShdORjWXBg 5kz1/OFgOCpRAGe8bEcxSzdHxL8LNzVDpL4L0unU= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/92103] constraints not checked on nested class template Date: Thu, 04 Jun 2020 17:21:30 +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: 10.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: --- 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 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Jun 2020 17:21:31 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D92103 --- Comment #5 from CVS Commits --- The releases/gcc-10 branch has been updated by Patrick Palka : https://gcc.gnu.org/g:a3a71447513cd6aee06631e1cc73a530e2c7fd95 commit r10-8228-ga3a71447513cd6aee06631e1cc73a530e2c7fd95 Author: Patrick Palka Date: Thu Jun 4 13:03:58 2020 -0400 c++: constrained nested partial specialization [PR92103] When determining the most specialized partial specialization of a primary template that is nested inside a class template, we first tsubst the outer template arguments into the TEMPLATE_DECL of each partial specialization, and then check for satisfaction of each of the new TEMPLATE_DECL's constraints. But tsubst_template_decl does not currently guarantee that constraints from the original DECL_TEMPLATE_RESULT get reattached to the new DECL_TEMPLATE_RESULT. In the testcase below, this leads to the constraints_satisfied_p check in most_specialized_partial_spec to trivially return true for each of the partial specializations. I'm not sure if such a guarantee would be desirable, but in this case we can just check constraints_satisfied_p on the original TEMPLATE_DECL instead of on the tsubsted TEMPLATE_DECL here, which is what this patch does (alongside some reorganizing). gcc/cp/ChangeLog: PR c++/92103 * pt.c (most_specialized_partial_spec): Reorganize the loop over DECL_TEMPLATE_SPECIALIZATIONS. Check constraints_satisfied_p on the original template declaration, not on the tsubsted one. gcc/testsuite/ChangeLog: PR c++/92103 * g++.dg/cpp2a/concepts-partial-spec7.C: New test. (cherry picked from commit aee69073cdb8086d393f12474c6177e75467ceaa)=