这个例子来自N4527 14.7.3 [temp.expl.spec] / 5,有点变化。
template<class T>
struct A {
struct B{};
};
template<> struct A<char>::B{
void f();
struct C;
struct D{}; // ok
};
void A<char>::B::f(){}// ok in gcc5.1.0 and clang3.6.0
struct A<char>::B::C{};// error in gcc5.1.0, ok in clang3.6.0
int main()
{
return 0;
}