Why is it that the C++ standard specify that unqualified names in a template are non-dependent?
e.g.
template<typename T>
class Base
{
public:
T x;
};
template<typename T>
class C : public Base<T>
{
public:
bool m() { return x == 0; } // Error: undeclared identifier 'x'
};
Quoting from the accepted answer to an SO question about how to overcome the restriction:
The standard specifies that unqualified names in a template are non-dependent and must be looked up when the template is defined. The definition of a dependent base class is unknown at that time (specializations of the base class template may exist) so unqualified names are unable to be resolved.
However, the quoted and other answers do not specify why this is what the standard specifies. What is the rationale for this restriction?