]> git.ipfire.org Git - thirdparty/gcc.git/commit
c++: Fix list-init of array of no-copy type [PR63707]
authorJason Merrill <jason@redhat.com>
Fri, 15 Jan 2021 16:42:00 +0000 (11:42 -0500)
committerJason Merrill <jason@redhat.com>
Fri, 29 Jan 2021 16:23:22 +0000 (11:23 -0500)
commitca02f0a0eb0fbeb3c1e01c3a55a95b0690ecfabc
tree1f8ea4d5e7a94e4cbe77cf118f4fa474964e0b16
parenta7e6e7a9299208e5aa3d805d502370d59f92b8b5
c++: Fix list-init of array of no-copy type [PR63707]

build_vec_init_elt models initialization from some arbitrary object of the
type, i.e. copy, but in the case of list-initialization we don't do a copy
from the elements, we initialize them directly.

gcc/cp/ChangeLog:

PR c++/63707
* tree.c (build_vec_init_expr): Don't call build_vec_init_elt
if we got a CONSTRUCTOR.

gcc/testsuite/ChangeLog:

PR c++/63707
* g++.dg/cpp0x/initlist-array13.C: New test.
gcc/cp/tree.c
gcc/testsuite/g++.dg/cpp0x/initlist-array13.C [new file with mode: 0644]