diff options
author | Douglas Gregor <dgregor@apple.com> | 2009-10-14 17:30:58 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2009-10-14 17:30:58 +0000 |
commit | 542b548e041a6fab0fe06601ccc6b91a81bc217a (patch) | |
tree | 94e7c6d926244bbd6ded5b077a02bf75e17f5107 /lib/Sema/SemaTemplate.cpp | |
parent | 31b63beefa058aa42a12a1c2b72b43a4ba21f7f1 (diff) |
When mapping from an injected-class-name to its corresponding
template, make sure to get the template that corresponds to *this*
declaration of the class template or specialization, rather than the
canonical specialization. Fixes PR5187.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84119 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaTemplate.cpp')
-rw-r--r-- | lib/Sema/SemaTemplate.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Sema/SemaTemplate.cpp b/lib/Sema/SemaTemplate.cpp index 4a410ecb14..d56b4e114e 100644 --- a/lib/Sema/SemaTemplate.cpp +++ b/lib/Sema/SemaTemplate.cpp @@ -45,7 +45,7 @@ static NamedDecl *isAcceptableTemplateName(ASTContext &Context, NamedDecl *D) { // which could be the current specialization or another // specialization. if (Record->isInjectedClassName()) { - Record = cast<CXXRecordDecl>(Record->getCanonicalDecl()); + Record = cast<CXXRecordDecl>(Record->getDeclContext()); if (Record->getDescribedClassTemplate()) return Record->getDescribedClassTemplate(); |