fix Issue 12485 - [REG2.065] DMD crashes when recursive template expansion