Is there one more bug of the gcc compiler relative to inherited constructors?

125 views Asked by At

This code does not compile using gcc HEAD 10.0.0 20190 but compiles using clang HEAD 9.0.0

#include <iostream>

struct A
{
    A() = default;
    A( int ) {}
};

struct B
{
    B() = default;
    B( const char * ) {}
};

template <typename...Bases>
struct C : Bases...
{
    using Bases::Bases...;
};

int main()
{
}

The error is

rog.cc:18:23: error: parameter packs not expanded with '...':
   18 |     using Bases::Bases...;
      |                       ^~~
prog.cc:18:23: note:         'Bases'
1

There are 1 answers

0
Lightness Races in Orbit On BEST ANSWER

Expansions are only allowed in using-declarations since C++17. (ref)

Looks like your GCC version just doesn't have that new feature yet, or does but in a buggy way (e.g. bug 79094).