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++/108438] [11/12/13/14/15 Regression] ICE in cxx_eval_constant_expression, at cp/constexpr.cc:7611
Date: Sat, 08 Jun 2024 11:13:53 +0000	[thread overview]
Message-ID: <bug-108438-4-xWZi0D7F9y@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-108438-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #3 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Simon Martin <simartin@gcc.gnu.org>:

https://gcc.gnu.org/g:2c9643c27ecddb7f597d34009d89e932b4aca58e

commit r15-1114-g2c9643c27ecddb7f597d34009d89e932b4aca58e
Author: Simon Martin <simon@nasilyan.com>
Date:   Fri Jun 7 11:21:07 2024 +0200

    c++: Make *_cast<*> parsing more robust to errors [PR108438]

    We ICE upon the following when trying to emit a -Wlogical-not-parentheses
    warning:

    === cut here ===
    template <typename T> T foo (T arg, T& ref, T* ptr) {
      int a = 1;
      return static_cast<T!>(a);
    }
    === cut here ===

    This patch makes *_cast<*> parsing more robust by skipping to the closing
'>'
    upon error in the target type.

    Successfully tested on x86_64-pc-linux-gnu.

            PR c++/108438

    gcc/cp/ChangeLog:

            * parser.cc (cp_parser_postfix_expression): Use
            cp_parser_require_end_of_template_parameter_list to skip to the
closing
            '>' upon error parsing the target type of *_cast<*> expressions.

    gcc/testsuite/ChangeLog:

            * g++.dg/parse/crash75.C: New test.

  parent reply	other threads:[~2024-06-08 11:13 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-17 17:53 [Bug c++/108438] New: [10/11/12/13 " gscfq@t-online.de
2023-01-17 21:00 ` [Bug c++/108438] " mpolacek at gcc dot gnu.org
2023-01-18  9:00 ` rguenth at gcc dot gnu.org
2023-07-07 10:44 ` [Bug c++/108438] [11/12/13/14 " rguenth at gcc dot gnu.org
2024-06-07  9:05 ` [Bug c++/108438] [11/12/13/14/15 " simartin at gcc dot gnu.org
2024-06-08 11:13 ` cvs-commit at gcc dot gnu.org [this message]
2024-06-08 11:15 ` simartin at gcc dot gnu.org
2024-06-08 14:53 ` sjames 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-108438-4-xWZi0D7F9y@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).