This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/68709] New: incorrectly requiring move-constructibility when list-initializing a polymorphic array element of a class member


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.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]