From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id B85EC385B1A7; Sat, 3 Dec 2022 09:01:54 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B85EC385B1A7 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1670058114; bh=VZGwSIJFCaMx8mP+sSzbA8XCDrUU82L2prxdvpJEOfk=; h=From:To:Subject:Date:From; b=PtqhZ0SZOE41AbY7KTXAhq3bQsNzFoMkvlut5LA4/AfnSUXzQjPWOy8wK2ZnxXgT+ mmTxTNPYFbrh09cvkK5gBQud0DxEhPayni3XGX1h4MXBjnXz0Dd5H3eGa5q1cKvooq N9fa305LMBihNptsM2/+gOt+LStdMPwO9YC9qW38= From: "onebit74 at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: =?UTF-8?B?W0J1ZyBjKysvMTA3OTU1XSBOZXc6IElDRTogdHJ5aW5nIHRvIGNh?= =?UTF-8?B?cHR1cmUg4oCYQVJHUyMw4oCZIGluIGluc3RhbnRpYXRpb24gb2YgZ2VuZXJp?= =?UTF-8?B?YyAgbGFtYmRh?= Date: Sat, 03 Dec 2022 09:01:54 +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.2.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: onebit74 at gmail 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=3D107955 Bug ID: 107955 Summary: ICE: trying to capture =E2=80=98ARGS#0=E2=80=99 in inst= antiation of generic lambda Product: gcc Version: 12.2.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: onebit74 at gmail dot com Target Milestone: --- The code is valid If you comment out the if, it compiles. If you comment out the branches in the if, it compiles as well. But somehow putting them together gives ICE. #include template struct agg_p { F f; void _parse(auto...ARGS){ [&](auto...P_ARGS){ using result =3D std::invoke_result_t; if constexpr(!std::same_as){ f(ARGS...,P_ARGS...); }else{ f(ARGS...,P_ARGS...); } }(1); } }; int main(){ auto add =3D [](auto a, auto b){return a+b;}; auto agg =3D agg_p(add); int i; agg._parse(i); }=