From: John McCall Date: Thu, 30 Jun 2011 21:59:02 +0000 (+0000) Subject: No, actually, we do need to be able to mangle substituted template names. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b44e0cf937baf99578b2a5bdf5066c730247d424;p=clang No, actually, we do need to be able to mangle substituted template names. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134195 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/AST/ItaniumMangle.cpp b/lib/AST/ItaniumMangle.cpp index 0cbf1f7bdf..9e647ad410 100644 --- a/lib/AST/ItaniumMangle.cpp +++ b/lib/AST/ItaniumMangle.cpp @@ -1369,9 +1369,16 @@ void CXXNameMangler::mangleType(TemplateName TN) { break; } - case TemplateName::SubstTemplateTemplateParm: - llvm_unreachable("mangling a substituted template name!"); - break; + case TemplateName::SubstTemplateTemplateParm: { + // Substituted template parameters are mangled as the substituted + // template. This will check for the substitution twice, which is + // fine, but we have to return early so that we don't try to *add* + // the substitution twice. + SubstTemplateTemplateParmStorage *subst + = TN.getAsSubstTemplateTemplateParm(); + mangleType(subst->getReplacement()); + return; + } case TemplateName::SubstTemplateTemplateParmPack: { SubstTemplateTemplateParmPackStorage *SubstPack