From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id E3F20385781F; Thu, 30 Mar 2023 21:09:14 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E3F20385781F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1680210554; bh=5S1ZhrGbgglV3o8ukmWt4mk2EGnrDiDMHlf1ZBkJStE=; h=From:To:Subject:Date:In-Reply-To:References:From; b=cWsBgHwokW4nEofRo123bpa30QemOlpSJ+1x6qRGnG0sIvKAJB71E3n9jP1+rzn54 thi/TO4Mzsu32C4MnUYTTpr3ou0jKOMaPMrah8vUVT3q1zt8zoxu/Q1r9WA27ta9eO hH39bzGhB68I3A0sxPq0tRAFgjCcK125pr5d3ma8= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/109319] [12/13 Regression] ICE in build_min_non_dep_op_overload, at cp/tree.cc:3793 since r12-5510 Date: Thu, 30 Mar 2023 21:09:13 +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 #5 from CVS Commits --- The master branch has been updated by Jakub Jelinek : https://gcc.gnu.org/g:c016887c91a79d67b6a3c7e19b9219f5ab1e2a4d commit r13-6946-gc016887c91a79d67b6a3c7e19b9219f5ab1e2a4d 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.=