Consider this code,
template
struct Sample
{
typename T::X *x; //declare pointer to T\'s X
};
In the above code, the key
Your code seems to go into a very gray area.
This paragraph on name hiding
A class name (9.1) or enumeration name (7.2) can be hidden by the name of a variable, data member, function, or enumerator declared in the same scope. If a class or enumeration name and a variable, data member, function, or enumerator are declared in the same scope (in any order) with the same name, the class or enumeration name is hidden wherever the variable, data member, function, or enumerator name is visible.
seems to indicate that the compiler is right to complain that A::X
is not a type name.