fix Issue 11843 - Template instantiated twice: failed semantic analysis
Merge pull request #3049 from 9rnsr/fix11843

Issue 11843 - Template instantiated twice: failed semantic analysis