From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 95C7E3858D32; Mon, 15 Jan 2024 23:40:20 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 95C7E3858D32 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1705362020; bh=FKxIYU/zo0MRyWseGgT0dmntGdID1Fg8fJatq7U+jXA=; h=From:To:Subject:Date:In-Reply-To:References:From; b=aKBSTMBpOEJ0gYwO/zpKcbu5hGXNMJAZoWbwotzhDv4ogmGUVH8FuCbYAoy8xYvuv B/Qh/fCZeOUiDzv7v6d5FRIAJjd+ptn+tqzMgCNgCO6KnCDFmkm+CxD6UHM/Y+w9Q8 0F3n225g35hOTQJ+iQkYPP38JG0drJwBwbp7/WUE= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/110065] [11/12/13/14 Regression] [C++20/2b] auto return type in template argument causes ICE, also accepts-invalid Date: Mon, 15 Jan 2024 23:40:20 +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.1.0 X-Bugzilla-Keywords: accepts-invalid, 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: mpolacek at gcc dot gnu.org X-Bugzilla-Target-Milestone: 12.4 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=3D110065 --- Comment #5 from GCC Commits --- The trunk branch has been updated by Marek Polacek : https://gcc.gnu.org/g:a3054489117085c095e480c71b6aaeea9a463c37 commit r14-7264-ga3054489117085c095e480c71b6aaeea9a463c37 Author: Marek Polacek Date: Mon Jan 15 09:15:59 2024 -0500 c++: ICE with auto in template arg [PR110065] Here we started crashing with r14-1659 because that removed the auto checking in cp_parser_template_type_arg which seemed like dead code. But the attached test shows that the code can still be reached because cp_parser_type_id_1 checks auto only when auto_is_implicit_function_template_parm_p is on. Then I noticed that we're still crashing in C++20, and that ICE started with r12-4772. So I changed the reemerged check to use flag_concepts_ts rather than flag_concepts on the basis that check_auto_in_tmpl_args also checks flag_concepts_ts. PR c++/110065 gcc/cp/ChangeLog: * parser.cc (cp_parser_template_type_arg): Add auto checking. gcc/testsuite/ChangeLog: * g++.dg/concepts/auto8.C: New test. * g++.dg/concepts/auto8a.C: New test.=