From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id A1CF53895FDD; Fri, 10 Feb 2023 17:45:24 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A1CF53895FDD DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1676051124; bh=VEv++VSCgh8VoV+uDO0HrgczjD2rDrlsOEvuCoXI7iA=; h=From:To:Subject:Date:In-Reply-To:References:From; b=pNlDizAs1GnyRFUSylePujVc/5CATHpHBPxFwI9HcNRiy96HWoOt35XbhWHin1mbZ O4QewKS9Twl4K3jphY/yyWq+dFfBOP/gFvV6NDhtkDSW/7igPPt3rlE/1uOZ8ueDYs Jmc9RGMUmD3VL79JxqVvMLGLRxvgCVPnvO0Yw/8A= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/108206] [12 Regression] ICE: tree check: expected tree that contains 'decl minimal' structure, have 'error_mark' in merge_default_template_args, at cp/decl.cc:1563 since r12-7562-gfe548eb8436f3906 Date: Fri, 10 Feb 2023 17:45:23 +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: error-recovery, ice-checking, ice-on-invalid-code X-Bugzilla-Severity: trivial X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P4 X-Bugzilla-Assigned-To: jakub at gcc dot gnu.org X-Bugzilla-Target-Milestone: 12.3 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=3D108206 --- Comment #6 from CVS Commits --- The releases/gcc-12 branch has been updated by Jakub Jelinek : https://gcc.gnu.org/g:7048e8c1073fcf2bf6be1a3d079393a78864ca61 commit r12-9137-g7048e8c1073fcf2bf6be1a3d079393a78864ca61 Author: Jakub Jelinek Date: Wed Jan 4 18:42:31 2023 +0100 c++: Error recovery in merge_default_template_args [PR108206] We ICE on the following testcase during error recovery, both new_parm and old_parm are error_mark_node, the ICE is on error ("redefinition of default argument for %q+#D", new_parm= ); inform (DECL_SOURCE_LOCATION (old_parm), "original definition appeared here"); where we don't print anything useful for new_parm and ICE trying to access DECL_SOURCE_LOCATION of old_parm. I think we shouldn't diagnose anything when either of the parms is erroneous, GCC 11 before merge_default_template_args has been added was doing if (TREE_VEC_ELT (tmpl_parms, i) =3D=3D error_mark_node || TREE_VEC_ELT (parms, i) =3D=3D error_mark_node) continue; tmpl_parm =3D TREE_VALUE (TREE_VEC_ELT (tmpl_parms, i)); if (error_operand_p (tmpl_parm)) return false; in redeclare_class_template. 2023-01-04 Jakub Jelinek PR c++/108206 * decl.cc (merge_default_template_args): Return false if either new_parm or old_parm are erroneous. * g++.dg/template/pr108206.C: New test. (cherry picked from commit fc349931adcf1024ee95e0a0cd98cf4a41996093)=