From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id F3E9F3858C66; Tue, 1 Aug 2023 01:26:41 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org F3E9F3858C66 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1690853202; bh=7Fbdbks+YI89Q/zI9NeTBYFyFoF0Drw+gr7eyGLWmvo=; h=From:To:Subject:Date:In-Reply-To:References:From; b=g5XZBszxjENz6wGSzFktYrRZyDijl+5kjIwf8Y+OkF6HXT9ugrdMf3SaZc/KwdeGq vRA/r23MA+uB8WPN0KoCbYUTn/c1RGPye/zVQ+ug+Qb6/WkeN8GcfwLL75tfOjdlqz ZwK58njNCXZgKQ9DnDKHDdzPQpowwWC+5O7tnDE8= From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/104113] invalid template argument causes the type to become int which confuses the rest of the diagnostic Date: Tue, 01 Aug 2023 01:26:40 +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: 12.0 X-Bugzilla-Keywords: diagnostic, FIXME X-Bugzilla-Severity: normal X-Bugzilla-Who: pinskia at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: pinskia at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- 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=3D104113 --- Comment #8 from Andrew Pinski --- (In reply to Andrew Pinski from comment #3) > from decl.cc: >=20 > if (type_was_error_mark_node && template_parm_flag) > /* FIXME we should be able to propagate the error_mark_node as is > for other contexts too. */ > type =3D error_mark_node; > else > type =3D integer_type_node; Changing this to not check template_parm_flag causes a regression in g++.dg/other/nontype-1.C . What happens is the type that happens here is now error_mark_node but the parser is not exacting that still. We get instead: ``` t1.cc:3:37: error: expected =E2=80=98)=E2=80=99 before =E2=80=98,=E2=80=99 = token 3 | Op::first_argument_type a, // { dg-error "not a type" } | ^ | ) t1.cc:2:11: note: to match this =E2=80=98(=E2=80=99 2 | bool asfun(Op f, | ^ ``` Which is totally bad error recovery ...=