Compiler Error C2947

'identifier' : cannot specialize a template-class with a reference to a local-extern

A template specialization was made with the address of a variable or function whose first declaration occurs in a local extern context.

The following is an example of this error:

template<int* p> class X {};
void func ()
{
    extern int i;
    X<&i> object;   // error emitted here
}