Answering this question, I got a surprising error from GCC and Clang:
template< typename = void >
struct Outer_temp
{
struct Inner;
Inner myinner;
};
template<>
struct Outer_temp<void>::Inner // Error: specialization of Outer_temp
{ // with member myinner of incomplete type.
};
Why does declaring an explicit specialization require implicit instantiation? Does this fall into the same category as all uses of the scope resolution operator?
Instantiating the template to find the declaration of a member object I would understand, but in the case of a member class, you can check that the member exists and is a class without instantiating anything. (You do need partial specialization resolution though.)