diff options
author | Douglas Gregor <dgregor@apple.com> | 2011-05-15 17:27:27 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2011-05-15 17:27:27 +0000 |
commit | 714c992099b3b9442759f29038bb3f2c5a59a23d (patch) | |
tree | 034273f52c6dd6cfd5c41f1e19f3413333d74219 /lib/Sema/SemaTemplate.cpp | |
parent | 7d16627081caede9691a6f46b796da4073ac14ad (diff) |
When checking a set of template parameter lists against a
nested-name-specifier, re-evaluate the nested-name-specifier as if we
were entering that context (which we did!), so that we'll resolve a
template-id to a particular class template partial
specialization. Fixes PR9913.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131383 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaTemplate.cpp')
-rw-r--r-- | lib/Sema/SemaTemplate.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/Sema/SemaTemplate.cpp b/lib/Sema/SemaTemplate.cpp index c31ed01737..aaadac2e5f 100644 --- a/lib/Sema/SemaTemplate.cpp +++ b/lib/Sema/SemaTemplate.cpp @@ -1513,8 +1513,13 @@ Sema::MatchTemplateParametersToScopeSpecifier(SourceLocation DeclStartLoc, // by the nested-name-specifier and walking out until we run out of types. llvm::SmallVector<QualType, 4> NestedTypes; QualType T; - if (SS.getScopeRep()) - T = QualType(SS.getScopeRep()->getAsType(), 0); + if (SS.getScopeRep()) { + if (CXXRecordDecl *Record + = dyn_cast_or_null<CXXRecordDecl>(computeDeclContext(SS, true))) + T = Context.getTypeDeclType(Record); + else + T = QualType(SS.getScopeRep()->getAsType(), 0); + } // If we found an explicit specialization that prevents us from needing // 'template<>' headers, this will be set to the location of that |