Description
[temp.pre] p3 states
A template-declaration is a declaration. A declaration introduced by a template declaration of a variable is a variable template. A variable template at class scope is a static data member template.
we have never defined the term template declaration, and the wording template declaration is used more than one time in clause [temp]. As well, the template also depends on the definition of template declaration.
An entity is templated if it is
- a template
As far as now, we only define the variable template. Thus, we may augment the definition for template, as well as, clarify the definition of template declaration.
Change [temp.pre] p3 to that
A template-declaration is a declaration, as known as a template declaration. A template-declaration introduces a template of the entity E(if any) introduced by the declaration in it. A variable template at class scope
isshall be a static data member template.
The proposal is fine to clarify a simple explicit specialization is not a template, conversely, a partial specialization is a template declaration, and any restriction applying to a templated entity can also apply to the entity defined in it:
template<class T>
struct A;
template<>
struct A<int>{}; // it is not a template declaration
template<class T>
struct B{};
template<class T>
struct B<T*>{
void fun() requires (sizeof(T)> 1); // [dcl.dcl.dcl.decl.general] p4 allows it.
};
Compare to defining a template-declaration is a declaration, I prefer to augment [syntax] to be that
X-declaration is a declaration.
That would cover: parameter-declaration, exception-declaration, and so on.