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++/92103] constraints not checked on nested class template Date: Wed, 03 Jun 2020 20:41:45 +0000 [thread overview] Message-ID: <bug-92103-4-iVjbwWTI8O@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-92103-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92103 --- 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:aee69073cdb8086d393f12474c6177e75467ceaa commit r11-884-gaee69073cdb8086d393f12474c6177e75467ceaa Author: Patrick Palka <ppalka@redhat.com> Date: Wed Jun 3 16:40:28 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.
next prev parent reply other threads:[~2020-06-03 20:41 UTC|newest] Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top [not found] <bug-92103-4@http.gcc.gnu.org/bugzilla/> 2020-06-02 19:15 ` ppalka at gcc dot gnu.org 2020-06-03 20:41 ` cvs-commit at gcc dot gnu.org [this message] 2020-06-04 17:21 ` cvs-commit at gcc dot gnu.org 2020-06-04 17:22 ` ppalka at gcc dot gnu.org 2020-06-04 22:34 ` cvs-commit at gcc dot gnu.org 2020-11-25 18:10 ` cvs-commit 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-92103-4-iVjbwWTI8O@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).