In C++, the typename keyword is needed so the compiler can disambiguate between nested types and nested values in templates. However, there are certain situati
Firstly, I don't think there ever was an intent to make a sharp and precise distinction between the situations where only typenames are allowed (like base class name) and situations where non-type entities are allowed as well (like expressions). I'd say that the base class name context was singled out for some other reason.
Secondly, it is not exactly correct to say that in function parameter declarations every entity is necessarily a typename. You can declare a parameter as follows
template
void foo(const T::type& v[T::value]);
Of course, the grammar in this case explicitly dictates that type must be a typename and value must be a value. However, the compiler can only figure that out after the syntactic analysis of the declaration, while I believe the idea of typename was introduced to aid the compiler in actually starting the proper syntactic analysis of the code, i.e. the distinction should be available before the syntactic analysis, as an input into the syntactic analysis. This distinction might have profound effects on the interpretation of the code.