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

            Bug ID: 79094
           Summary: Pack explansion in using-declaration rejects an
                    attempt to inherit a pack of constructors
           Product: gcc
           Version: 7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: ville.voutilainen at gmail dot com
  Target Milestone: ---

template <class... Args> struct X : Args... 
{
    using Args::Args...;
}; 

int main() 
{
    struct A {A() = default; A(int) {}}; 
    struct B {B() = default; B(double) {}}; 
    X<A, B> x1{42}; 
    X<A, B> x2{666.0};  
}

Clang accepts the code. GCC rejects it:

prog.cc:3:21: error: parameter packs not expanded with '...':
     using Args::Args...;
                     ^~~
prog.cc:3:21: note:         'Args'
prog.cc: In function 'int main()':
prog.cc:10:18: warning: missing initializer for member 'X<main()::A,
main()::B>::<anonymous>' [-Wmissing-field-initializers]
     X<A, B> x1{42};
                  ^
prog.cc:11:21: warning: missing initializer for member 'X<main()::A,
main()::B>::<anonymous>' [-Wmissing-field-initializers]
     X<A, B> x2{666.0};
                     ^

Reply via email to