[ItaniumDemangle] Add template name to the substitutions list during demangling (#108538)

When demangling a template template parameter (`method<bool,
Bar>(Bar<bool> b)`), the current demangler version first enters the
template argument (`bool`) into the substitutions list, then the whole
template specialization (`Bar<bool>`). The template name (`Bar`) never
becomes a substitution candidate on its own.

This is different when mangling. Mangling `method<bool, Bar>(Bar<bool>
b, Bar<int> i)` substitutes the `Bar` in the second parameter with the
substitution for `TemplateTemplateParmDecl`.

This leads to a discrepancy between mangler and demangler, see
https://github.com/llvm/llvm-project/issues/108009.

NOKEYCHECK=True
GitOrigin-RevId: 2612316f72b92d7905717c358aeab8b8141738a1
2 files changed