From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id DC8C83858C52; Thu, 19 Jan 2023 00:33:48 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DC8C83858C52 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1674088428; bh=hAbjiJlRoalzjOPpwWf4VVQvkBY9pyLAlCAPQFlL5LQ=; h=From:To:Subject:Date:In-Reply-To:References:From; b=sCaq/lIFUyZ7BkiE65u6qD9cSh91Ln2JMkPjMP6+PZpPwdJhDtzTqz1P1lrbKnNaZ Em1kO2tGJ2SDrVsS791vJJq9y9avfZnPB9kd8S2BO4yuITOLQDmS3AgvdYcVEj7EQ1 cwODd4KdTeIJnv5SQ99P/xBmZtyGd4TIMRxi9KMM= From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/104512] [c++20] consteval constructor does not need to initialize all data members Date: Thu, 19 Jan 2023 00:33:48 +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: 12.0 X-Bugzilla-Keywords: rejects-valid X-Bugzilla-Severity: normal X-Bugzilla-Who: pinskia at gcc dot gnu.org 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: see_also 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=3D104512 Andrew Pinski changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://github.com/llvm/llv | |m-project/issues/57627, | |https://gcc.gnu.org/bugzill | |a/show_bug.cgi?id=3D106485 --- Comment #2 from Andrew Pinski --- ``` struct B { bool b =3D true; int i; consteval B() {} }; static_assert( []() consteval{ return B{}.b; }() ); ``` Works for GCC. I think this is a bug in clang ... static_assert is an immediate function context so B{} needs to be a evaluat= ed and such. See https://github.com/llvm/llvm-project/issues/57627 for the clang bug. See also https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D106485#c2 .=