diff options
author | Douglas Gregor <dgregor@apple.com> | 2009-07-30 17:40:51 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2009-07-30 17:40:51 +0000 |
commit | b88e888404ad0a2bdd9bfae457e8530bb38a87c5 (patch) | |
tree | 0ddb6d55fd383dfb6a5cb6ce7cb3afda20729a07 /lib/Sema/SemaCXXScopeSpec.cpp | |
parent | 17edea8b0befb10066f7c6f5b01469d2fb679c9b (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/Sema/SemaCXXScopeSpec.cpp')
-rw-r--r-- | lib/Sema/SemaCXXScopeSpec.cpp | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/lib/Sema/SemaCXXScopeSpec.cpp b/lib/Sema/SemaCXXScopeSpec.cpp index a5a20307ac..1580e721d3 100644 --- a/lib/Sema/SemaCXXScopeSpec.cpp +++ b/lib/Sema/SemaCXXScopeSpec.cpp @@ -55,14 +55,23 @@ DeclContext *Sema::computeDeclContext(const CXXScopeSpec &SS, if (ClassTemplateDecl *ClassTemplate = dyn_cast_or_null<ClassTemplateDecl>( SpecType->getTemplateName().getAsTemplateDecl())) { + QualType ContextType + = Context.getCanonicalType(QualType(SpecType, 0)); + // If the type of the nested name specifier is the same as the // injected class name of the named class template, we're entering // into that class template definition. QualType Injected = ClassTemplate->getInjectedClassNameType(Context); - if (Context.hasSameType(Injected, QualType(SpecType, 0))) + if (Context.hasSameType(Injected, ContextType)) return ClassTemplate->getTemplatedDecl(); - // FIXME: Class template partial specializations + // If the type of the nested name specifier is the same as the + // type of one of the class template's class template partial + // specializations, we're entering into the definition of that + // class template partial specialization. + if (ClassTemplatePartialSpecializationDecl *PartialSpec + = ClassTemplate->findPartialSpecialization(ContextType)) + return PartialSpec; } } @@ -195,6 +204,7 @@ CXXRecordDecl *Sema::getCurrentInstantiationOf(NestedNameSpecifier *NNS) { if (T == Context.getCanonicalType(InjectedClassName)) return Template->getTemplatedDecl(); } + // FIXME: check for class template partial specializations } return 0; |