https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91319

--- Comment #5 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The trunk branch has been updated by Marek Polacek <mpola...@gcc.gnu.org>:

https://gcc.gnu.org/g:4a92205ef1da044eaf9490e61787836a3abe7d6c

commit r14-3577-g4a92205ef1da044eaf9490e61787836a3abe7d6c
Author: Marek Polacek <pola...@redhat.com>
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."  Hence
    this patch sets CONSTRUCTOR_IS_DIRECT_INIT only when we are dealing with
    ".x{}", but not ".x = {}".

            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.
  • [Bug c++/91319] Designated init... cvs-commit at gcc dot gnu.org via Gcc-bugs

Reply via email to