Fixed #4710 (Template parser bug: const in constructor changes template names)