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

            Bug ID: 65300
           Summary: If one more constructor is defined, default params on
                    using not passed from parent class
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: webmatematika at hotmail dot com

Created attachment 34937
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=34937&action=edit
gcc t.cpp --std=c++11

I am wondering why class B compiles without problems, but class C shows errors
on c4 construction, as default arguments are not passed. If this is by
Standard, could you point me to that paragraph? Thank you for your time.

t.cpp: In function ‘int main()’:
t.cpp:24:4: error: no matching function for call to ‘C::C()’
  C c4;
    ^
t.cpp:24:4: note: candidates are:
t.cpp:13:12: note: C::C(int, int)
   using A::A;
            ^
t.cpp:13:12: note:   candidate expects 2 arguments, 0 provided
t.cpp:13:12: note: C::C(int)
t.cpp:13:12: note:   candidate expects 1 argument, 0 provided
t.cpp:14:3: note: C::C(int, int, int)
   C(int c1, int c2, int c3) : A(c1, c2) {}
   ^
t.cpp:14:3: note:   candidate expects 3 arguments, 0 provided
t.cpp:11:7: note: constexpr C::C(const C&)
 class C : public A {
       ^
t.cpp:11:7: note:   candidate expects 1 argument, 0 provided
t.cpp:11:7: note: constexpr C::C(C&&)
t.cpp:11:7: note:   candidate expects 1 argument, 0 provided

Reply via email to