I (vaguely) know that a template is not instantiated if it is not used. For example, the following code will compile fine even though T::type
A quick look at 3.2 [basic.def.odr] yields:
3/ [...] A virtual member function is odr-used if it is not pure. [...]
And I also found at 14.7.1 [temp.inst]:
10/ An implementation shall not implicitly instantiate a function template, a member template, a non-virtual member function, a member class, or a static data member of a class template that does not require instantiation. It is unspecified whether or not an implementation implicitly instantiates a virtual member function of a class template if the virtual member function would not otherwise be instantiated. (emphasis mine)
So... I would say it is likely that a virtual
method will always be instantiated.
In pragmatic terms, I would expect a compiler to instantiate the virtual table of a template class when it instantiates the class; and thus immediately instantiate all virtual
member functions of this class (so it can references those from the virtual table).