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

            Bug ID: 104418
           Summary: Error inheriting base class constructors by
                    using-declaration
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: fchelnokov at gmail dot com
  Target Milestone: ---

This code
```
struct B {
    B(int) {}
    B(int&&) {}
};

int i = 1;
B b(i); //ok everywhere

struct C : B {
    using B::B;
};

C c(i); //ok in Clang only
```
is accepted in Clang, but GCC complains:
```
<source>:13:6: error: use of deleted function 'C::C(int) [inherited from B]'
   13 | C c(i);
      |      ^
<source>:10:14: note: 'C::C(int) [inherited from B]' is implicitly deleted
because the default definition would be ill-formed:
   10 |     using B::B;
      |              ^
<source>:10:14: error: call of overloaded 'B(int)' is ambiguous
```
Demo: https://gcc.godbolt.org/z/79EoYM94d

Related question: https://stackoverflow.com/q/71005539/7325599

Reply via email to