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

--- Comment #1 from Freddie Chopin <freddie_chopin at op dot pl> ---
The question at stackoverflow has an answer with much simpler test-case which
also shows the problem. http://stackoverflow.com/a/27810002/157344

--- >8 --- >8 --- >8 --- >8 --- >8 --- >8 --- >8 --- >8 ---

template<typename... T>
struct Functor
{
    template <T...>
    struct Inner
    {};
};

template struct Functor<>::Inner<>;

int main()
{

}

--- >8 --- >8 --- >8 --- >8 --- >8 --- >8 --- >8 --- >8 ---

Compiled with GCC 4.9.2:

--- >8 --- >8 --- >8 --- >8 --- >8 --- >8 --- >8 --- >8 ---

$ g++ -std=c++11 test.cpp 
test.cpp: In instantiation of ‘struct Functor<>’:
test.cpp:9:26:   required from here
test.cpp:5:12: error: wrong number of template arguments (1, should be 0)
     struct Inner
            ^
test.cpp:5:12: error: provided for ‘template<class ... T> template<T
...<anonymous> > struct Functor<T>::Inner’
test.cpp:5:12: error: wrong number of template arguments (1, should be 0)
test.cpp:5:12: error: provided for ‘template<class ... T> template<T
...<anonymous> > struct Functor<T>::Inner’
test.cpp:9:28: error: ‘Inner’ is not a class template
 template struct Functor<>::Inner<>;
                            ^
test.cpp:9:28: error: ‘Inner’ in ‘struct Functor<>’ does not name a type

--- >8 --- >8 --- >8 --- >8 --- >8 --- >8 --- >8 --- >8 ---

Works fine with GCC 4.8.

The answer also suggests there might be another similar bug, possibly related
to the first one.

Reply via email to