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

--- Comment #5 from Jonathan Wakely <redi at gcc dot gnu.org> ---
The member array case only fails when the array element has a user-defined
destructor

Here's the failing testcase repeated from the attachment and reduced slightly:

struct Child
{
    Child (int);
    ~Child ();
    Child (const Child &) = delete;
};

struct Parent
{
    Parent () : children {{5}, {7}} {}

    Child children[2];
};


i.cc: In constructor ‘Parent::Parent()’:
i.cc:12:35: error: use of deleted function ‘Child::Child(const Child&)’
     Parent () : children {{5}, {7}} {}
                                   ^
i.cc:6:5: note: declared here
     Child (const Child &) = delete;
     ^

Commenting out the destructor declaration allows it to compile.

Reply via email to