From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id C1C833858C2D; Tue, 18 Apr 2023 07:16:09 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C1C833858C2D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1681802169; bh=ZeQ/fU1SvVQCBwlnx4iCT5XzaBJ7+RGsfcc1s+D+/Kc=; h=From:To:Subject:Date:In-Reply-To:References:From; b=O2uRid+gKfiHno2tqwiy9AuDVa0HPve6BtM4r10pslHLytZs3/5NDB+ln1EOm5Izr qFrkG8z/oDC8BckRSQmDwY/MAadusn/71cPcvBXPzlINdzb+0yQhoCv/8VEWYtvWfH A22dv3i81rticBCMctOqxXe7wuQ1XRIZVi7YM3+Y= From: "cvs-commit at gcc dot 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 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 13.0 X-Bugzilla-Keywords: ice-checking, ice-on-invalid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: jakub at gcc dot gnu.org X-Bugzilla-Target-Milestone: 13.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D109319 --- Comment #7 from CVS Commits --- The releases/gcc-12 branch has been updated by Jakub Jelinek : https://gcc.gnu.org/g:6a5c0588ac00f6f55ae7ed2bb791e7e119a01c43 commit r12-9425-g6a5c0588ac00f6f55ae7ed2bb791e7e119a01c43 Author: Jakub Jelinek 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 express= ions (those which didn't go through make_args_non_dependent) into a single index using comma expression(s). 2023-03-30 Jakub Jelinek PR c++/109319 * decl2.cc (grok_array_decl): After emitting a pedwarn for -Wcomma-subscript, if processing_template_decl set orig_index_e= xp to compound expr from orig_index_exp_list. * g++.dg/cpp23/subscript14.C: New test. (cherry picked from commit c016887c91a79d67b6a3c7e19b9219f5ab1e2a4d)=