[cfe-commits] r134195 - /cfe/trunk/lib/AST/ItaniumMangle.cpp

John McCall rjmccall at apple.com
Thu Jun 30 14:59:02 PDT 2011


Author: rjmccall
Date: Thu Jun 30 16:59:02 2011
New Revision: 134195

URL: http://llvm.org/viewvc/llvm-project?rev=134195&view=rev
Log:
No, actually, we do need to be able to mangle substituted template names.


Modified:
    cfe/trunk/lib/AST/ItaniumMangle.cpp

Modified: cfe/trunk/lib/AST/ItaniumMangle.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/ItaniumMangle.cpp?rev=134195&r1=134194&r2=134195&view=diff
==============================================================================
--- cfe/trunk/lib/AST/ItaniumMangle.cpp (original)
+++ cfe/trunk/lib/AST/ItaniumMangle.cpp Thu Jun 30 16:59:02 2011
@@ -1369,9 +1369,16 @@
     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





More information about the cfe-commits mailing list