https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68709
Bug ID: 68709
Summary: incorrectly requiring move-constructibility when
list-initializing a polymorphic array element of a
class member
Product: gcc
Version: 6.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: richard-gccbugzilla at metafoo dot co.uk
Target Milestone: ---
GCC incorrectly rejects this:
struct A { virtual ~A(); };
struct B {
B();
B(B &&) = delete;
A middle_field;
};
struct C {
C() : b{{}, {}} {}
B b[2];
};
saying:
<stdin>: In constructor ‘C::C()’:
<stdin>:8:17: error: use of deleted function ‘B::B(B&&)’
<stdin>:4:3: note: declared here
This is bogus: C's constructor should not invoke the B move constructor.