From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id ACEED3858D26; Wed, 22 May 2024 19:06:00 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org ACEED3858D26 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1716404760; bh=x5kwGe3kFtJpWrO5Q27mZWq8dBqMjpZLO/TAcBnLLHE=; h=From:To:Subject:Date:From; b=AR+7cltBKTt8UTy64W8jADaMNqT9oe/j1OQ8VFzToUt+X+NoVPxxVH9VTqeLLNAMs HQ2o5IflXUri++4zM/lGxCGEU7Zbpg4Jt7pjlyyu6YzOLkg3QNCUQfciC3NfwIoSR2 8BOV6fxImmbMGXj98ByKfvepqHH0pLcjb6snd/b8= From: "patrick at rivosinc dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/115195] New: [12 Regression] Segfault when instantiating template Date: Wed, 22 May 2024 19:06:00 +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: 12.3.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: patrick at rivosinc 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 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=3D115195 Bug ID: 115195 Summary: [12 Regression] Segfault when instantiating template Product: gcc Version: 12.3.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: patrick at rivosinc dot com Target Milestone: --- Testcase: enum a { b }; using c =3D int; template void e(int, int, int, c *, d, int) { [](auto) { [] { struct { } f; }; }; } int g, h; a i() { return b; e({}, {}, g, &h, [] {}, {}); } Backtrace (from godbolt since it's more verbose than my local backtrace): > g++-12 reduced.cc : In instantiation of 'void e(int, int, int, c*, d, int) [with d =3D i()::; c =3D int]': :14:4: required from here :5:5: internal compiler error: Segmentation fault 5 | [] { | ^ 0x1bbabfe internal_error(char const*, ...) ???:0 0x10b0223 walk_tree_1(tree_node**, tree_node* (*)(tree_node**, int*, void*), void*, hash_set >*, tree_node* (*)(tree_node**, int*, tree_node* (*)(tree_node**, int*, void*), void*, hash_set >*)) ???:0 0x10b0516 walk_tree_1(tree_node**, tree_node* (*)(tree_node**, int*, void*), void*, hash_set >*, tree_node* (*)(tree_node**, int*, tree_node* (*)(tree_node**, int*, void*), void*, hash_set >*)) ???:0 0x10b0223 walk_tree_1(tree_node**, tree_node* (*)(tree_node**, int*, void*), void*, hash_set >*, tree_node* (*)(tree_node**, int*, tree_node* (*)(tree_node**, int*, void*), void*, hash_set >*)) ???:0 0x870a79 check_for_bare_parameter_packs(tree_node*, unsigned int) ???:0 0x8a7dfb finish_expr_stmt(tree_node*) ???:0 0x891a08 tsubst_lambda_expr(tree_node*, tree_node*, int, tree_node*) ???:0 0x87e337 instantiate_decl(tree_node*, bool, bool) ???:0 0x899e8b instantiate_pending_templates(int) ???:0 0x7a5298 c_parse_final_cleanups() ???:0 Please submit a full bug report, with preprocessed source. Please include the complete backtrace with any bug report. See for instructions. Godbolt: https://godbolt.org/z/dda478Po6 Only on GCC 12.=