aboutsummaryrefslogtreecommitdiff
path: root/lib/AST/ItaniumMangle.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2011-02-28 00:04:36 +0000
committerDouglas Gregor <dgregor@apple.com>2011-02-28 00:04:36 +0000
commitaa2187de137e5b809dcbbe14f3b61ae907a3d8aa (patch)
tree0ae99c9f08c57720161ca3e0c2e1709506543945 /lib/AST/ItaniumMangle.cpp
parentc2c90011a688c04a4e980282f08c267e081c4b00 (diff)
When we encounter a dependent template name within a
nested-name-specifier, e.g., T::template apply<U>:: represent the dependent template name specialization as a DependentTemplateSpecializationType, rather than a TemplateSpecializationType with a dependent TemplateName. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126593 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/ItaniumMangle.cpp')
-rw-r--r--lib/AST/ItaniumMangle.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/lib/AST/ItaniumMangle.cpp b/lib/AST/ItaniumMangle.cpp
index 939ca7a924..8474ea3633 100644
--- a/lib/AST/ItaniumMangle.cpp
+++ b/lib/AST/ItaniumMangle.cpp
@@ -625,6 +625,17 @@ void CXXNameMangler::mangleUnresolvedScope(NestedNameSpecifier *Qualifier) {
TST->getNumArgs());
addSubstitution(QualType(TST, 0));
}
+ } else if (const DependentTemplateSpecializationType *DTST
+ = dyn_cast<DependentTemplateSpecializationType>(QTy)) {
+ TemplateName Template
+ = getASTContext().getDependentTemplateName(DTST->getQualifier(),
+ DTST->getIdentifier());
+ mangleTemplatePrefix(Template);
+
+ // FIXME: GCC does not appear to mangle the template arguments when
+ // the template in question is a dependent template name. Should we
+ // emulate that badness?
+ mangleTemplateArgs(Template, DTST->getArgs(), DTST->getNumArgs());
} else {
// We use the QualType mangle type variant here because it handles
// substitutions.
@@ -1596,7 +1607,7 @@ void CXXNameMangler::mangleType(const DependentNameType *T) {
}
void CXXNameMangler::mangleType(const DependentTemplateSpecializationType *T) {
- // Dependently-scoped template types are always nested
+ // Dependently-scoped template types are nested if they have a prefix.
Out << 'N';
// TODO: avoid making this TemplateName.