On the grammar of explicit specialization
explicit-specialization:
template < > declaration
declaration:
- block-declaration
- nodeclspec-function-declaration
- ...
- explicit-instantiation
- ...
The declaration could be anything that is a valid declaration on its grammar. Consider this example
template<class T>
struct A{
template<class Y>
struct B{};
};
template<>
template struct A<int>::B<int>; //declaration: explicit-instantiation
Both GCC and Clang cannot recognize the syntax. Where is the rule that restricts the declaration cannot be an explicit instantiation?