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

            Bug ID: 68372
           Summary: [concepts] invalid use of pack expansion expression in
                    member function template declaration
           Product: gcc
           Version: 6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: lucdanton at free dot fr
  Target Milestone: ---

I can't really understand the error and I don't know the rules very well, but
here goes.

$ g++-trunk --version
g++-trunk (GCC) 6.0.0 20151103 (experimental)
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$ g++-trunk -std=c++1z main.cpp
main.cpp: In substitution of 'template<class ... X>  requires predicate(
C<X>...) void foo::bar(X ...) [with X = {}]':
main.cpp:18:16:   required from here
main.cpp:11:10: error: invalid use of pack expansion expression
     void bar(X...)
          ^
$ cat main.cpp  
template<typename X> concept bool C = true;

// fine
template<C... X>
void bar(X...)
{}

struct foo {
    // error: invalid use of pack expansion expression
    template<C... X>
    void bar(X...)
    {}
};

int main()
{
    bar();
    foo {}.bar();
}

Reply via email to