I have a question specifically about clang's behavior when we declare a variable template within a class scope. What the Standard stated about this is (N4296::14/1 [temp]
):
A variable template at class scope is a static data member template.
I thought that any variable template (static and non-static) is going to be declared as just static data member template. But actually, clang
prevent declaring non-static data member template ever.
template <class U>
struct A
{
template <class T, const T& t>
int a; //non-static data member template
};
int main(){}
My question is how the rule actually should be treated. Does it mean a compiler should declare any data member template as a static data template member implicitly?