Compiler Error C2926

'type' : types with no linkage cannot be used as template arguments

There was an attempt to generate a template class (that is, a class generated from a class template) based on a local type. A template can be instantiated only using a type with external linkage.

The following code will generate this error:

template<class T> class X{};

void f()
{
    struct Y{};

    X<Y> x;         // error
}