From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id D214A3858C52; Thu, 19 Jan 2023 01:26:42 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D214A3858C52 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1674091602; bh=lR3zlou5gfC+yKJTXK2phxVHQ5OQlGMU6qpXPTLM4NM=; h=From:To:Subject:Date:In-Reply-To:References:From; b=XAdLYPK5rMKNGO1fJ4UWL3fCdBKqe9mfur1smb0JP4G2LxtqZgiXjsqEzaReNLXPj 0FVizce79WDLVPNM84xjYysS9CeEFGwRaIRQTiT8s6H4euNTsVd9lY47jl65Zqprq2 KkFRRWU9yJ6CcKCT27zTmwPU+EqidH/FpRbZLP2U= From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/95968] error: 'args#0' is not a constant expression Date: Thu, 19 Jan 2023 01:26:41 +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: 10.1.0 X-Bugzilla-Keywords: c++-lambda, diagnostic X-Bugzilla-Severity: normal X-Bugzilla-Who: pinskia at gcc dot gnu.org 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: keywords 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=3D95968 Andrew Pinski changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords|rejects-valid | --- Comment #3 from Andrew Pinski --- (In reply to Andrew Pinski from comment #2) > The following is the reduced testcase: > struct test_class > { > consteval test_class( double pack_) { } > }; >=20 > void test_func()=20 > { > auto t =3D [](const auto... args) {return test_class(args...);}; > t(1.0); > } >=20 > are lambdas consteval by default? I know they are implicit constexpr but I > don't think they are consteval though. They are not until C++23 (See PR 107687 for the status on that). This is just a diagnostic issue. add constevalue like this to the reduced testcase allows the testcase to work: auto t =3D [](const auto... args) consteval {return test_class(args...)= ;}; Note the original testcase still has issues even if you add consteval to the lambda and I suspect because std::apply still has issues ...=