fix Issue 11843 - Template instantiated twice: failed semantic analysis