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 | 568a071dd2384788c6319935709f77a4dff15f7a (patch) | |
tree | 9265c0c61dcea72a520a4fb3bca06b112e1ff167 /clang/lib/Sema/SemaTemplate.cpp | |
parent | 92f86199236e914aad6d98213c860478b88e98d4 (diff) | |
download | bcm5719-llvm-568a071dd2384788c6319935709f77a4dff15f7a.tar.gz bcm5719-llvm-568a071dd2384788c6319935709f77a4dff15f7a.zip |
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.
llvm-svn: 84119
Diffstat (limited to 'clang/lib/Sema/SemaTemplate.cpp')
-rw-r--r-- | clang/lib/Sema/SemaTemplate.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaTemplate.cpp b/clang/lib/Sema/SemaTemplate.cpp index 4a410ecb146..d56b4e114e7 100644 --- a/clang/lib/Sema/SemaTemplate.cpp +++ b/clang/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(); |