From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 0D7DE3858D35; Thu, 29 Jun 2023 14:39:01 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0D7DE3858D35 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1688049541; bh=zVuhTMtg1rmIauN+8uLVSWYxpmv5KFBppNEALDjfDQ0=; h=From:To:Subject:Date:From; b=AhGHHvqUbeq0IRK3l6eXU4EL9LD5FcVHSzeE0hTlRuBddpewDS5JLCytp5Ibhj4NK cYATGB5TdkeKsMSj5KWjyD/uLI8kCxEpdLyyHeeH1LRKq8UaZrICiT8OyzkXkCxNDf VnYE22lGjSEK0l2JUSvl/yS55wxLcuVB5djgejA4= From: "hewillk at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/110486] New: gcc rejects constant expression with consteval lambda Date: Thu, 29 Jun 2023 14:39: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: 14.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: hewillk 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=3D110486 Bug ID: 110486 Summary: gcc rejects constant expression with consteval lambda Product: gcc Version: 14.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: hewillk at gmail dot com Target Milestone: --- GCC rejects the following, while MSVC and Clang compile fine. Not sure if the code is well-formed. #include constexpr auto g =3D []() consteval { std::vector v; v.push_back(0); return v; }; constexpr auto l =3D [] { constexpr auto sz =3D g().size(); return 0; }(); https://godbolt.org/z/WrTx3bn3r=