fix Issue 7469 - template mangling depends on instantiation order