From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 05705385840D; Wed, 30 Aug 2023 18:26:33 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 05705385840D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1693419994; bh=237G/M0JxMU9gCwVle/cd2ZVZvu31qLCJY2ZSBoukvU=; h=From:To:Subject:Date:In-Reply-To:References:From; b=iqHM4/JCpyCLx/kRMDOacZiu9Bg8Z8XfwOmIomaAvkbuS7DYECZwm5ZQiletkAk8y r2HIEE4AFNrxuWOawl6ukOUDtvUdIBOb6LgVQ3UxdfAAEyAW3wMambmjwhdGEcL2++ 6J3m64pfaeXvGtwUFPOj9ZT1hbqWQCa5Vn4ELKGA= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/91319] Designated initializer doesn't support direct-initialization Date: Wed, 30 Aug 2023 18:26:33 +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: 9.1.0 X-Bugzilla-Keywords: rejects-valid X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: mpolacek 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=3D91319 --- Comment #5 from CVS Commits --- The trunk branch has been updated by Marek Polacek : https://gcc.gnu.org/g:4a92205ef1da044eaf9490e61787836a3abe7d6c commit r14-3577-g4a92205ef1da044eaf9490e61787836a3abe7d6c Author: Marek Polacek Date: Fri Aug 25 11:47:54 2023 -0400 c++: CWG 2359, wrong copy-init with designated init [PR91319] This CWG clarifies that designated initializer support direct-initialization. Just be careful what Note 2 in [dcl.init.aggr]/4.2 says: "If the initialization is by designated-initializer-clause, its form determines whether copy-initialization or direct-initialization is performed." He= nce this patch sets CONSTRUCTOR_IS_DIRECT_INIT only when we are dealing with ".x{}", but not ".x =3D {}". PR c++/91319 gcc/cp/ChangeLog: * parser.cc (cp_parser_initializer_list): Set CONSTRUCTOR_IS_DIRECT_INIT when the designated initializer is of the .x{} form. gcc/testsuite/ChangeLog: * g++.dg/cpp2a/desig30.C: New test.=