If an instantiation of a template is required to be a complete type, check
whether the definition of the template is visible rather than checking whether
the instantiated definition happens to be in an imported module.