From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 362623858C83; Thu, 2 Mar 2023 23:54:39 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 362623858C83 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1677801279; bh=akhyTVAkmFRc2+wB7SZ7ROgnHQGMamhlNbIZou0Xgbs=; h=From:To:Subject:Date:From; b=xFdH0txMx0PlhNUzMOGz7IublUUfJ2dKUkIR5M+P/Mt6x9QsWuRSgbUYyIOTLg7nF aCb3tQW1I2fMdXQln/sGWybO4oQAvPnIngw5Er01v5xr+5r8LLRJGsnwkTVvEXajT7 Fix0ifSvknmJo+bgfO4dcBoLADbhxgIiJMqgFu0I= From: "waffl3x at protonmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/108998] New: ICE in tsubst, at cp/pt.cc:16037 Date: Thu, 02 Mar 2023 23:54:38 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 13.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: waffl3x at protonmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone attachments.created Message-ID: 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=3D108998 Bug ID: 108998 Summary: ICE in tsubst, at cp/pt.cc:16037 Product: gcc Version: 13.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: waffl3x at protonmail dot com Target Milestone: --- Created attachment 54573 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=3D54573&action=3Dedit the output of -v on godbolt at the time of posting this report template inline constexpr bool templ =3D false; template void ice(T a) { auto aa =3D a; auto lambda =3D [](){ if constexpr (templ) {} }; lambda.template operator()<0>(); } void go() { ice(0); } https://godbolt.org/z/4qn9s6cad The conditions for this were rather complicated, this was as far as I could reduce it. Some things to note, it does not trigger when the lambda's template parameter is a type paramete= r, it does not trigger with an auto function parameter, it does not trigger outside of if constexpr, and it does not trigger when the first argument to templ is not a lambda's template parameter. I couldn't find a way to trigger it without a lambda's non type template parameter. : In instantiation of 'ice(int):: [with int I =3D 0]= ': :11:34: required from 'void ice(T) [with T =3D int]' :15:8: required from here :7:10: internal compiler error: in tsubst, at cp/pt.cc:16037 7 | auto aa =3D a; | ^~ 0x247996e internal_error(char const*, ...) ???:0 0xae93fe fancy_abort(char const*, int, char const*) ???:0 0xd11fdd tsubst(tree_node*, tree_node*, int, tree_node*) ???:0 0xd13f4d tsubst_template_args(tree_node*, tree_node*, int, tree_node*) ???:0 0xd09c65 instantiate_decl(tree_node*, bool, bool) ???:0 0xbdf731 maybe_instantiate_decl(tree_node*) ???:0 0xbe11be mark_used(tree_node*, int) ???:0 0xb16f0e build_new_method_call(tree_node*, tree_node*, vec**, tree_node*, int, tree_node**, int) ???:0 0xd09c65 instantiate_decl(tree_node*, bool, bool) ???:0 0xd35ffb instantiate_pending_templates(int) ???:0 0xbe4325 c_parse_final_cleanups() ???:0 0xe215f8 c_common_parse_file() ???:0=