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

            Bug ID: 77731
           Summary: Parameter pack expansion doesn't work when  used to
                    define argument list
           Product: gcc
           Version: 6.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: michele.caini at gmail dot com
  Target Milestone: ---

I refer to there questions on SO:
*
http://stackoverflow.com/questions/39690166/can-i-expand-a-parameters-pack-and-define-an-arguments-list-with-it
*
http://stackoverflow.com/questions/39665300/gcc-vs-clang-variadic-template-and-pointers-to-member-methods

In particular, GCC fails to compile the following snippets, but it should work
according with [temp.variadic]:

// Snippet 1

    template<typename... T>
    struct S {
        template<T... I>
        void m() {}
    };

    int main() {
        S<int, char> s;
        s.m<0, 'c'>();
        // This works, but it shouldn't instead
        s.m<>();
    }

// Snippet 2

    struct S { void f() { } };
    struct T { void f() { } };

    template<typename... M>
    struct U: M... {
        template<void(M::*... F)(void)>
        void g() { }

        void f() {
            g<&M::f...>();
        }
    };

    int main() {
        U<S, T> u;
        u.f();
    }

The same applies to GCC v7.

Reply via email to