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++/101247] ICE when using static constexpr bool defined in parent-class in nested class constructor requires-clause
Date: Tue, 13 Jul 2021 14:03:38 +0000	[thread overview]
Message-ID: <bug-101247-4-cBmJ9aOMpL@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-101247-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101247

--- Comment #4 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-11 branch has been updated by Patrick Palka
<ppalka@gcc.gnu.org>:

https://gcc.gnu.org/g:2902f2d8424cfa365fec49401fa066e2b6de9ca4

commit r11-8732-g2902f2d8424cfa365fec49401fa066e2b6de9ca4
Author: Patrick Palka <ppalka@redhat.com>
Date:   Fri Jul 2 13:54:57 2021 -0400

    c++: unqualified member template in constraint [PR101247]

    Here any_template_parm_r is failing to mark the template parameters
    implicitly used by the unqualified use of 'd' inside the constraint
    because the code to do so assumes each level of a template parameter
    list points to the corresponding primary template, but here the
    parameter level for A in the out-of-line definition of A::B does not
    (nor do the parameter levels for A and C in the definition of A::C),
    which causes us to overlook the sharing.

    So it seems we can't in general depend on the TREE_TYPE of a template
    parameter level being non-empty here.  This patch partially fixes this
    by rewriting the relevant part of any_template_parm_r to not depend on
    the TREE_TYPE of outer levels.  We still depend on the innermost level
    to point to the innermost primary template, so we still crash on the
    commented out line in the below testcase.

            PR c++/101247

    gcc/cp/ChangeLog:

            * pt.c (any_template_parm_r) <case TEMPLATE_DECL>: Rewrite to
            use common_enclosing_class and to not depend on the TREE_TYPE
            of outer levels pointing to the corresponding primary template.

    gcc/testsuite/ChangeLog:

            * g++.dg/cpp2a/concepts-memtmpl4.C: New test.

    (cherry picked from commit e3528ce197f8886869f95e8a8f901861a319851c)

  parent reply	other threads:[~2021-07-13 14:03 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-29  1:15 [Bug c++/101247] New: ICE when using static constexpr bool defined in base-class in derived " lewissbaker.opensource at gmail dot com
2021-06-29  8:11 ` [Bug c++/101247] " marxin at gcc dot gnu.org
2021-06-30 18:16 ` [Bug c++/101247] ICE when using static constexpr bool defined in parent-class in nested " ppalka at gcc dot gnu.org
2021-07-02 17:55 ` cvs-commit at gcc dot gnu.org
2021-07-09 14:22 ` cvs-commit at gcc dot gnu.org
2021-07-13 14:03 ` cvs-commit at gcc dot gnu.org [this message]
2021-07-13 14:03 ` cvs-commit at gcc dot gnu.org
2021-07-13 14:09 ` 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-101247-4-cBmJ9aOMpL@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: link
Be 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).