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++/108975] [10/11/12/13 Regression] ICE on constexpr variable used as nontype template since r9-5473-ge32fc4499f863f
Date: Fri, 17 Mar 2023 23:33:04 +0000	[thread overview]
Message-ID: <bug-108975-4-leOVWPWP4E@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-108975-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #13 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The trunk branch has been updated by Jason Merrill <jason@gcc.gnu.org>:

https://gcc.gnu.org/g:6f90de97634d6f1617a054429f28b85fbfbd8b6f

commit r13-6743-g6f90de97634d6f1617a054429f28b85fbfbd8b6f
Author: Jason Merrill <jason@redhat.com>
Date:   Fri Mar 17 17:26:40 2023 -0400

    c++: constant, array, lambda, template [PR108975]

    When a lambda refers to a constant local variable in the enclosing scope,
we
    tentatively capture it, but if we end up pulling out its constant value, we
    go back at the end of the lambda and prune any unneeded captures.  Here
    while parsing the template we decided that the dim capture was unneeded,
    because we folded it away, but then we brought back the use in the template
    trees that try to preserve the source representation with added type info.
    So then when we tried to instantiate that use, we couldn't find what it was
    trying to use, and crashed.

    Fixed by not trying to prune when parsing a template; we'll prune at
    instantiation time.

            PR c++/108975

    gcc/cp/ChangeLog:

            * lambda.cc (prune_lambda_captures): Don't bother in a template.

    gcc/testsuite/ChangeLog:

            * g++.dg/cpp0x/lambda/lambda-const11.C: New test.

  parent reply	other threads:[~2023-03-17 23:33 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-28 20:57 [Bug c++/108975] New: Internal compiler error on constexpr variable used as nontype template samuelpmish at gmail dot com
2023-02-28 20:58 ` [Bug c++/108975] " pinskia at gcc dot gnu.org
2023-02-28 21:10 ` samuelpmish at gmail dot com
2023-02-28 21:11 ` pinskia at gcc dot gnu.org
2023-02-28 21:11 ` pinskia at gcc dot gnu.org
2023-02-28 21:35 ` pinskia at gcc dot gnu.org
2023-03-01 10:54 ` pinskia at gcc dot gnu.org
2023-03-01 10:59 ` [Bug c++/108975] [10/11/12/13 Regression] " pinskia at gcc dot gnu.org
2023-03-01 11:07 ` pinskia at gcc dot gnu.org
2023-03-01 11:10 ` pinskia at gcc dot gnu.org
2023-03-01 15:26 ` samuelpmish at gmail dot com
2023-03-01 15:51 ` ppalka at gcc dot gnu.org
2023-03-02 21:35 ` [Bug c++/108975] [10/11/12/13 Regression] ICE on constexpr variable used as nontype template since r9-5473-ge32fc4499f863f ppalka at gcc dot gnu.org
2023-03-03 20:32 ` mpolacek at gcc dot gnu.org
2023-03-17 21:24 ` jason at gcc dot gnu.org
2023-03-17 23:33 ` cvs-commit at gcc dot gnu.org [this message]
2023-04-18 20:46 ` [Bug c++/108975] [10/11/12 " cvs-commit at gcc dot gnu.org
2023-04-21 20:28 ` [Bug c++/108975] [10/11 " cvs-commit at gcc dot gnu.org
2023-04-22  0:23 ` cvs-commit at gcc dot gnu.org
2023-04-25 19:59 ` cvs-commit at gcc dot gnu.org
2023-07-07 10:45 ` [Bug c++/108975] [11 " rguenth at gcc dot gnu.org
2023-12-19 20:00 ` jason at gcc dot gnu.org
2023-12-19 20:16 ` ppalka at gcc dot gnu.org
2023-12-20  1:53 ` cvs-commit at gcc dot gnu.org
2023-12-20  1:55 ` cvs-commit at gcc dot gnu.org
2023-12-20  1:56 ` cvs-commit at gcc dot gnu.org
2023-12-20  1:59 ` 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-108975-4-leOVWPWP4E@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).