From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 61A433851150; Thu, 27 Oct 2022 12:08:30 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 61A433851150 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1666872510; bh=/nzVORMJ4XY0Rq9jnHLXf0KafuOquZOC2Zw3f2PNCQE=; h=From:To:Subject:Date:From; b=kXI5RxtY/7BjuQRG+jkCE9HZYNQgi4jMEluVrAvC4ir+1OEtkdmMqhuOoQwKfu9eW H3kaF3cFVEt657n+L1AQOedpr/1D9g1EoXKbEQsYTs+tH8GI1lWwKgoBrE7sOTmaB1 QZavd5S9Ax1YJ1MBRbfywhvSnREOkHupnwkaLeBM= From: "chfast at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/107434] New: Wrong -Wmissing-field-initializers for C++ designated initializers Date: Thu, 27 Oct 2022 12:08:28 +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: 13.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: chfast 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=3D107434 Bug ID: 107434 Summary: Wrong -Wmissing-field-initializers for C++ designated initializers Product: gcc Version: 13.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: chfast at gmail dot com Target Milestone: --- If a struct S has a field c of type C having user constructor the "missing-field-initializers" is reported for this field even though designa= ted initializers are used. struct C { int x =3D 0; }; struct S { C c; bool flag =3D false; }; S test() { return {.flag =3D true}; } : In function 'S test()': :15:25: warning: missing initializer for member 'S::c' [-Wmissing-field-initializers] 15 | return {.flag =3D true}; | ^ https://godbolt.org/z/sxc8PP7Pq=