From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 72D633857824; Thu, 10 Sep 2020 17:55:12 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 72D633857824 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1599760512; bh=awd8YFneHe7TQysdGP2HpMKumoXiPGXI9fMUQO1tQRg=; h=From:To:Subject:Date:In-Reply-To:References:From; b=rsENWEgDT5jQ0SHUfAowXfOfh21q2dnTQKxG+dy60UM2lPJWwvki3qTAP39E+yXLZ hkcjB/VdsM4YqVcWKVt/vCYOWYqA27ZnYU6g4MvNqmrWwUiTdcq/8CAOu5TQSC+KDW bqBfcVBQRokaFpU/JEMskoMog41gfg6sUdKbQOj8= From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/96994] Missing code from consteval constructor initializing const variable Date: Thu, 10 Sep 2020 17:55: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: unknown X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: jakub 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: 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 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Sep 2020 17:55:12 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D96994 --- Comment #3 from Jakub Jelinek --- Though: struct A { consteval A (int x) { i =3D x; } int i =3D 0; }; struct B { constexpr B (int x) { i =3D x; } int i =3D 0; }; A const a =3D 1; constexpr A b =3D 2; B const c =3D 3; A constinit d =3D 4; static_assert (b.i =3D=3D 2); int main() { if (a.i !=3D 1 || c.i !=3D 3 || d.i !=3D 4) __builtin_abort (); } works fine, so the problem is maybe just with default construction for consteval ctor.=