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++/109319] [12 Regression] ICE in build_min_non_dep_op_overload, at cp/tree.cc:3793 since r12-5510
Date: Tue, 18 Apr 2023 07:16:09 +0000	[thread overview]
Message-ID: <bug-109319-4-Dr5n81TJFi@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-109319-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #7 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-12 branch has been updated by Jakub Jelinek
<jakub@gcc.gnu.org>:

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

commit r12-9425-g6a5c0588ac00f6f55ae7ed2bb791e7e119a01c43
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Thu Mar 30 23:08:25 2023 +0200

    c++: Fix up ICE in build_min_non_dep_op_overload [PR109319]

    The following testcase ICEs, because grok_array_decl during
    processing_template_decl handling of a non-dependent subscript
    emits a -Wcomma-subscript pedwarn, we decide to pass to the
    single index argument the index expressions as if it was wrapped
    with () around it, but then when preparing it for later instantiation
    we don't actually take that into account and ICE on a mismatch of
    number of index arguments (the overload expects a single index,
    testcase has two index expressions in this case).
    For non-dependent subscript which are builtin subscripts we also
    emit the same pedwarn and don't ICE, but emit the same pedwarn
    again whenever we instantiate it, which is also IMHO undesirable,
    it is enough to warn once during parsing the template.

    The following patch fixes it by turning even the original index expressions
    (those which didn't go through make_args_non_dependent) into a single
    index using comma expression(s).

    2023-03-30  Jakub Jelinek  <jakub@redhat.com>

            PR c++/109319
            * decl2.cc (grok_array_decl): After emitting a pedwarn for
            -Wcomma-subscript, if processing_template_decl set orig_index_exp
            to compound expr from orig_index_exp_list.

            * g++.dg/cpp23/subscript14.C: New test.

    (cherry picked from commit c016887c91a79d67b6a3c7e19b9219f5ab1e2a4d)

  parent reply	other threads:[~2023-04-18  7:16 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-28 18:53 [Bug c++/109319] New: [13 Regression] ICE in build_min_non_dep_op_overload, at cp/tree.cc:3793 gscfq@t-online.de
2023-03-28 18:59 ` [Bug c++/109319] " mpolacek at gcc dot gnu.org
2023-03-29  7:06 ` rguenth at gcc dot gnu.org
2023-03-29 11:45 ` [Bug c++/109319] [12/13 Regression] ICE in build_min_non_dep_op_overload, at cp/tree.cc:3793 since r12-5510 jakub at gcc dot gnu.org
2023-03-29 13:38 ` jakub at gcc dot gnu.org
2023-03-30 21:09 ` cvs-commit at gcc dot gnu.org
2023-04-03 13:16 ` [Bug c++/109319] [12 " jakub at gcc dot gnu.org
2023-04-18  7:16 ` cvs-commit at gcc dot gnu.org [this message]
2023-04-18  7:20 ` jakub 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-109319-4-Dr5n81TJFi@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).