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++/112437] ICE with throw inside concept sometimes and -std=c++20
Date: Thu, 01 Feb 2024 15:50:17 +0000	[thread overview]
Message-ID: <bug-112437-4-Gli4yA9kHU@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-112437-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #5 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-12 branch has been updated by Marek Polacek
<mpolacek@gcc.gnu.org>:

https://gcc.gnu.org/g:4617c9b6eb22062a319dcdbddb8c3cebce398c15

commit r12-10124-g4617c9b6eb22062a319dcdbddb8c3cebce398c15
Author: Marek Polacek <polacek@redhat.com>
Date:   Wed Jan 31 17:33:26 2024 -0500

    c++: ICE with throw inside concept [PR112437]

    We crash in the loop at the end of treat_lvalue_as_rvalue_p for code
    like

      template <class T>
      concept Throwable = requires(T x) { throw x; };

    because the code assumes that we eventually reach sk_function_parms or
    sk_try and bail, but in a concept we're in a sk_namespace.

    We're already checking sk_try so we don't crash in a function-try-block,
    but I've added a test anyway.

            PR c++/112437

    gcc/cp/ChangeLog:

            * typeck.cc (treat_lvalue_as_rvalue_p): Bail out on sk_namespace in
            the move on throw of parms loop.

    gcc/testsuite/ChangeLog:

            * g++.dg/cpp2a/concepts-throw1.C: New test.
            * g++.dg/eh/throw4.C: New test.

    (cherry picked from commit 65b105b4f399559685200e1598ead8c7d0935c04)

  parent reply	other threads:[~2024-02-01 15:50 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-08  5:22 [Bug c++/112437] New: " pinskia at gcc dot gnu.org
2023-11-08  5:28 ` [Bug c++/112437] " pinskia at gcc dot gnu.org
2023-11-08  5:29 ` pinskia at gcc dot gnu.org
2023-11-08 12:00 ` redi at gcc dot gnu.org
2024-01-24  3:08 ` mpolacek at gcc dot gnu.org
2024-02-01 14:00 ` cvs-commit at gcc dot gnu.org
2024-02-01 15:41 ` cvs-commit at gcc dot gnu.org
2024-02-01 15:50 ` cvs-commit at gcc dot gnu.org [this message]
2024-02-01 15:56 ` mpolacek 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-112437-4-Gli4yA9kHU@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).