From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id B8744385843E; Fri, 8 Jul 2022 12:14:13 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B8744385843E From: "drahflow at gmx dot de" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/106233] New: Designated initializers targeting inherited fields breaks reshape_init_class, at cp/decl.c:6456 Date: Fri, 08 Jul 2022 12:14:13 +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: 11.2.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: drahflow at gmx dot de 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 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: Fri, 08 Jul 2022 12:14:13 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D106233 Bug ID: 106233 Summary: Designated initializers targeting inherited fields breaks reshape_init_class, at cp/decl.c:6456 Product: gcc Version: 11.2.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: drahflow at gmx dot de Target Milestone: --- In a vain attempt to use designated initializers to target inherited fields= , I discovered that running g++ -W -Wall --std=3Dc++20 ... on ... struct Base { int i; }; struct Derived: public Base { using Base::i; }; int main(void) { Derived d{ .i =3D 0, }; return d.i; } ... results in ... designated-usage.c++: In function =E2=80=98int main()=E2=80=99: designated-usage.c++:12:3: internal compiler error: in reshape_init_class, = at cp/decl.c:6456 12 | }; | ^ 0x7f080f8137fc __libc_start_main ../csu/libc-start.c:332 Please submit a full bug report, [...] ... for ... g++ --version g++ (Debian 11.2.0-18) 11.2.0 Copyright (C) 2021 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. GCC 12.1 gives : In function 'int main()': :12:3: error: 'Base::i' is not a direct member of 'Derived' 12 | }; | ^ Compiler returned: 1 ... the correctness of which I don't feel qualified to judge.=