From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 69E6F3858D28; Tue, 2 May 2023 06:17:26 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 69E6F3858D28 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1683008246; bh=Mib6uQBTx26wMh2VqW1JhV3lRIMivZeE3JsuLfP0WOA=; h=From:To:Subject:Date:From; b=uEajTVsLtsAI7hhyBBXioyJulnN82hr+LAh/6STO5/3SiM2QJ461yU8gFFMT5SipL ltXesqsOG31hfDtzS59SnjRfbROqazTRy6muy+m6yz6fmYW0Vw0NxJAKnv5mbdiWCs IYXRN2nKBXEAW9MK9vQ/6B5agDCpuibM7cTV/jWE= From: "rl.alt.accnt at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/109692] New: ICE on concept as default template parameter to iife lambda in fold expression in static member template function Date: Tue, 02 May 2023 06:17:25 +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: rl.alt.accnt 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=3D109692 Bug ID: 109692 Summary: ICE on concept as default template parameter to iife lambda in fold expression in static member template function Product: gcc Version: 13.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: rl.alt.accnt at gmail dot com Target Milestone: --- The following code raises an ICE on GCC (trunk) and all versions later than= and including GCC 11.3. Earlier versions simply fail to instantiate the templat= e. Both Clang and MSVC accept the code (see also this godbolt link: https://godbolt.org/z/x5Ys9sPzx): ```c++ template concept always_true =3D true; template struct variadic { template static void callee() { } static void bug() { ([]>() {=20 if constexpr (x) callee();=20 }(), ...); } }; int main() { variadic::bug(); } ``` GCC (trunk) on godbolt gives me this stack trace: : In instantiation of 'variadic::bug():: [with bool = x =3D true]': :9:10: required from 'static void variadic::bug() [with params =3D {int}]' :13:32: required from here :8:44: error: template argument 1 is invalid 8 | if constexpr (x) callee(); | ~~~~~~~~~~~~~~^~ :8:44: error: template argument 1 is invalid :8:44: internal compiler error: in constructor_name_p, at cp/name-lookup.cc:4721 0x23605ae internal_error(char const*, ...) ???:0 0xa6dd64 fancy_abort(char const*, int, char const*) ???:0 0xc81ee5 instantiate_decl(tree_node*, bool, bool) ???:0 0xb5c9e1 maybe_instantiate_decl(tree_node*) ???:0 0xb5e45e mark_used(tree_node*, int) ???:0 0xa9da44 build_op_call(tree_node*, vec**, int) ???:0 0xcc7264 finish_call_expr(tree_node*, vec**, b= ool, bool, int) ???:0 0xc79864 tsubst_pack_expansion(tree_node*, tree_node*, int, tree_node*) ???:0 0xc81ee5 instantiate_decl(tree_node*, bool, bool) ???:0 0xcad44b instantiate_pending_templates(int) ???:0 0xb61635 c_parse_final_cleanups() ???:0 0xd91568 c_common_parse_file() ???:0=