Any way how to instantiate templates even when it is not necessary for the compilation?

Is the original definition of the template available in the XML file, not just the reference to the specific instantiations (i.e. IMyEnumerator).

My gut tells me that if it isn’t already available, then it will be difficult as the instantiation has to occur for the final compilation, but that must be occurring in a later phase of compilation than the one where the XML file is generated. Their is also a good chance that the instantiation depends on information that isn’t available until after the XML file is generated (things like overload candidates found during argument dependent look-up). I am not very familiar with clang’s code or structure so this is just speculation, perhaps a query on clangs developers list might give you more insight into what options you may have.