fix Issue 10067 - Recursive template instantiation