aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2011-06-30 21:59:02 +0000
committerJohn McCall <rjmccall@apple.com>2011-06-30 21:59:02 +0000
commitb44e0cf937baf99578b2a5bdf5066c730247d424 (patch)
treef48c1f8ffff8e55699694bad71cfc897a965949c
parent935a70c1e76d78985f20d422940280161b941299 (diff)
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
-rw-r--r--lib/AST/ItaniumMangle.cpp13
1 files changed, 10 insertions, 3 deletions
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