arm g++ fails to consider default initializers when checking inherited constructors

Bug #1700870 reported by Luis Rayas on 2017-06-28
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
GNU ARM Embedded Toolchain
Undecided
Unassigned

Bug Description

This bug was reported for GCC: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62310

Still seems to be the case:

    class B
    {
    public:
      B(int b) : _b(b) {}

    private:
      int _b;
    };

    class N
    {
    public:
      N() = delete;
      N(int n) : _n(n) {}

    private:
      int _n;
    };

    struct D : public B
    {
      using B::B;
      N n{100};
    };

    int main(void)
    {
      D obj{200};
    }

$ arm-none-eabi-g++ --std=c++14 -c c.cc
    /tmp/c.cc: In function 'int main()':
    /tmp/c.cc:29:12: error: use of deleted function 'D::D(int)'
       D obj{200};
                ^
    /tmp/c.cc:23:12: note: 'D::D(int)' is implicitly deleted because the default definition would be ill-formed:
       using B::B;
                ^
    /tmp/c.cc:23:12: error: use of deleted function 'N::N()'
    /tmp/c.cc:14:3: note: declared here
       N() = delete;
       ^

Details:

arm-none-eabi-g++ 5.4.1 20160919 (release) binary package on MacOS Sierra

Bug report related to language support are better suited for bugzilla as we focus more on the platform support. I would suggest you ping the bugzilla ticket, perhaps people didn't notice it the first time.

Best regards.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers