From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 5149F3858C50; Sun, 4 Sep 2022 17:40:13 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5149F3858C50 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1662313213; bh=JPGmR8++NDWKN1AE0PYWgk+Eezcl2ajuUKMlRQ7VUbQ=; h=From:To:Subject:Date:In-Reply-To:References:From; b=CaWXfBmPrtDQH10I+Egxn+Wh2kYYNciSGK+8YDj6XmChBVXA2MhjtuKahxSyJC2gN 8DL+duHsyj7m1keh2l4uBRDP2KoU4L0HOEKu0SLjfaz+2GhRxOO4wkE06Dl6z+MXqB FegqA7bEzoReRMwOT9mm1Jachoj4H916D+9+FRno= From: "pobrn at protonmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/105667] [C++20] lambas in template argument sometimes causes an ICE (seg fault) Date: Sun, 04 Sep 2022 17:40:12 +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: c++-lambda, ice-on-valid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: pobrn at protonmail dot com X-Bugzilla-Status: NEW 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: cc 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=3D105667 Barnab=C3=A1s P=C5=91cze changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |pobrn at protonmail dot com --- Comment #6 from Barnab=C3=A1s P=C5=91cze = --- Another snippet that I believe triggers the same issue: template struct get { }; template struct thing { using T =3D decltype([](auto) { }); static constexpr auto value =3D [](auto) { return get(); }(0); }; thing<0> X; --- In this case template_parms_to_args() is called with a nullptr. template_parms_to_args (parms=3D0x0) at /usr/src/debug/gcc/gcc/cp/pt.cc:4912 tsubst_template_decl (t=3D0x7ffff7177280, args=3D, complain= =3D3, lambda_fntype=3D0x7ffff717b738) at /usr/src/debug/gcc/gcc/cp/pt.cc:14543 tsubst_lambda_expr (t=3D, args=3D0x7ffff7171d80, complain=3D= 3, in_decl=3D0x7ffff7173800) at /usr/src/debug/gcc/gcc/cp/pt.cc:19855 tsubst_copy_and_build (t=3D, args=3D0x7ffff7171d80, complain=3D, in_decl=3D0x7ffff7177000, function_p=3D, integral_constant_expression_p=3Dfalse) at /usr/src/debug/gcc/gcc/cp/pt.cc:= 21446 tsubst (t=3D0x7ffff71760a8, args=3D0x7ffff7171d80, complain=3D3, in_decl=3D0x7ffff7177000) at /usr/src/debug/gcc/gcc/cp/pt.cc:16400 tsubst_template_args (t=3D0x7ffff7171a20, args=3Dargs@entry=3D0x7ffff7171d8= 0, complain=3Dcomplain@entry=3D3, in_decl=3Din_decl@entry=3D0x7ffff7177000) at /usr/src/debug/gcc/gcc/cp/pt.cc:13580 [...] --- GCC 12.2.0, but GCC trunk on Compiler Explorer also exhibits the same issue= (as do GCC 11.1, 11.2, 11.3, 12.1, and 12.2)=