8sa1-gcc/gcc/testsuite/g++.dg/cpp0x/initlist-array13.C
Jason Merrill cd09079cfd 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.
2021-01-15 13:38:14 -05:00

17 lines
214 B
C

// PR c++/63707
// { dg-do compile { target c++11 } }
struct Child
{
Child (int);
~Child ();
Child (const Child &) = delete;
};
struct Parent
{
Parent () : children {{5}, {7}} {}
Child children[2];
};