aboutsummaryrefslogtreecommitdiff
path: root/lib/AST/ASTContext.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-07-30 17:40:51 +0000
committerDouglas Gregor <dgregor@apple.com>2009-07-30 17:40:51 +0000
commitb88e888404ad0a2bdd9bfae457e8530bb38a87c5 (patch)
tree0ddb6d55fd383dfb6a5cb6ce7cb3afda20729a07 /lib/AST/ASTContext.cpp
parent17edea8b0befb10066f7c6f5b01469d2fb679c9b (diff)
Support out-of-line definitions of the members of class template
partial specializations. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77606 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/ASTContext.cpp')
-rw-r--r--lib/AST/ASTContext.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/lib/AST/ASTContext.cpp b/lib/AST/ASTContext.cpp
index 66aa363c28..e9bcc04c28 100644
--- a/lib/AST/ASTContext.cpp
+++ b/lib/AST/ASTContext.cpp
@@ -1669,9 +1669,10 @@ ASTContext::getTemplateSpecializationType(TemplateName Template,
const TemplateArgument *Args,
unsigned NumArgs,
QualType Canon) {
- if (Canon.isNull()) {
- // Build the canonical template specialization type, since no type
- // was provided.
+ if (!Canon.isNull())
+ Canon = getCanonicalType(Canon);
+ else {
+ // Build the canonical template specialization type.
TemplateName CanonTemplate = getCanonicalTemplateName(Template);
llvm::SmallVector<TemplateArgument, 4> CanonArgs;
CanonArgs.reserve(NumArgs);
@@ -1695,16 +1696,16 @@ ASTContext::getTemplateSpecializationType(TemplateName Template,
8);
Spec = new (Mem) TemplateSpecializationType(*this, CanonTemplate,
CanonArgs.data(), NumArgs,
- QualType());
+ Canon);
Types.push_back(Spec);
TemplateSpecializationTypes.InsertNode(Spec, InsertPos);
}
- Canon = QualType(Spec, 0);
+ if (Canon.isNull())
+ Canon = QualType(Spec, 0);
assert(Canon->isDependentType() &&
"Non-dependent template-id type must have a canonical type");
- } else
- Canon = getCanonicalType(Canon);
+ }
// Allocate the (non-canonical) template specialization type, but don't
// try to unique it: these types typically have location information that