]> granicus.if.org Git - clang/commitdiff
No, actually, we do need to be able to mangle substituted template names.
authorJohn McCall <rjmccall@apple.com>
Thu, 30 Jun 2011 21:59:02 +0000 (21:59 +0000)
committerJohn McCall <rjmccall@apple.com>
Thu, 30 Jun 2011 21:59:02 +0000 (21:59 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134195 91177308-0d34-0410-b5e6-96231b3b80d8

lib/AST/ItaniumMangle.cpp

index 0cbf1f7bdf2f12f2b3d00f35555cb2bc01b7e41d..9e647ad410714279ab41fa811f79b405b4c761aa 100644 (file)
@@ -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