From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 59B643858401; Fri, 21 Apr 2023 10:50:00 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 59B643858401 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1682074200; bh=+YAoYqSOwsa9ciupsP28qcT6xLDxq1HvzvY4mn35FbI=; h=From:To:Subject:Date:In-Reply-To:References:From; b=EOAeT9J/fvTTUGstlN3KAlZdtU5irAsItnEvcjfVWdYFOadAJVQrjHG3hFb66YlFx zDZ2mhnKkxsbAdPXFOzCbjeiFxSTzOTJ1b1w0TrGJEYWHtRlO1tZdb61v/CkyTRGOD hkpwc7vlZDaCiqkbc08Vpgfj44d81t/opN6n0zB4= From: "redi at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/108993] Value initialization does not occur for derived class , for gcc versions > 5 Date: Fri, 21 Apr 2023 10:49:59 +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.2.0 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: redi 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D108993 --- Comment #13 from Jonathan Wakely --- And that's clearly the committee's intent: https://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#302 "Zero the object, then call the default generated constructor" ... "Zero fi= rst, and generate the object code for the default constructor when it's needed f= or value-initialization cases" https://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#543 "Change 9.4 [dcl.init] to specify that non-union class objects with no user-declared constructor are value-initialized by first zero-initializing = the object and then calling the (implicitly-defined) default constructor,"=