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++/98930] ICE with static variable in template function used as template argument
Date: Tue, 05 Oct 2021 13:50:36 +0000	[thread overview]
Message-ID: <bug-98930-4-lr7aLigPNa@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-98930-4@http.gcc.gnu.org/bugzilla/>

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

--- 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:f3930418cb82000fae3cb4e98e870428800cf295

commit r12-4186-gf3930418cb82000fae3cb4e98e870428800cf295
Author: Patrick Palka <ppalka@redhat.com>
Date:   Tue Oct 5 09:50:02 2021 -0400

    c++: templated static local var has value-dep addr [PR98930]

    Here uses_template_parms returns false for the dependent type A<&impl::i>,
    which causes tsubst_aggr_type to think it's non-dependent and not bother
    substituting into it, leading to breakage.

    This patch fixes this by making has_value_dependent_address also return
    true for templated static local variables.

            PR c++/98930

    gcc/cp/ChangeLog:

            * pt.c (has_value_dependent_address): Return true for a static
            local variable from a function template.

    gcc/testsuite/ChangeLog:

            * g++.dg/cpp1z/nontype4.C: New test.
            * g++.dg/cpp1z/nontype4a.C: New test.

  parent reply	other threads:[~2021-10-05 13:50 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-02  9:55 [Bug c++/98930] New: ICE when using function local static constexpr variable at runtime matthieum.147192 at gmail dot com
2021-10-02  6:10 ` [Bug c++/98930] " pinskia at gcc dot gnu.org
2021-10-02  6:12 ` pinskia at gcc dot gnu.org
2021-10-02  6:21 ` [Bug c++/98930] ICE with static variable in template function used as template argument pinskia at gcc dot gnu.org
2021-10-05 13:50 ` cvs-commit at gcc dot gnu.org [this message]
2021-10-05 13:53 ` 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-98930-4-lr7aLigPNa@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).