diff options
author | Douglas Gregor <dgregor@apple.com> | 2010-02-05 19:54:12 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2010-02-05 19:54:12 +0000 |
commit | b9397108c54851ce5f807420093df7102d5806a8 (patch) | |
tree | 24bd805532c99dc27ed1bfbebb31cf3318e00657 /clang/lib/Sema/SemaTemplateInstantiateDecl.cpp | |
parent | 64ffd11d4909b002809a5fbcfd3efcc44e754ca7 (diff) | |
download | bcm5719-llvm-b9397108c54851ce5f807420093df7102d5806a8.tar.gz bcm5719-llvm-b9397108c54851ce5f807420093df7102d5806a8.zip |
Fix two issues with the substitution of template template parameters
when instantiating the declaration of a member template:
- Only check if the have a template template argument at a specific position
when we already know that we have template arguments at that level;
otherwise, we're substituting for a level-reduced template template
parameter.
- When trying to find an instantiated declaration for a template
template parameter, look into the instantiated scope. This was a
typo, where we had two checks for TemplateTypeParmDecl, one of
which should have been a TemplateTemplateParmDecl.
With these changes, tramp3d-v4 passes -fsyntax-only.
llvm-svn: 95421
Diffstat (limited to 'clang/lib/Sema/SemaTemplateInstantiateDecl.cpp')
-rw-r--r-- | clang/lib/Sema/SemaTemplateInstantiateDecl.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp b/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp index 6597a853a80..e4017c5630b 100644 --- a/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp +++ b/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp @@ -2159,7 +2159,7 @@ NamedDecl *Sema::FindInstantiatedDecl(NamedDecl *D, const MultiLevelTemplateArgumentList &TemplateArgs) { DeclContext *ParentDC = D->getDeclContext(); if (isa<ParmVarDecl>(D) || isa<NonTypeTemplateParmDecl>(D) || - isa<TemplateTypeParmDecl>(D) || isa<TemplateTypeParmDecl>(D) || + isa<TemplateTypeParmDecl>(D) || isa<TemplateTemplateParmDecl>(D) || ParentDC->isFunctionOrMethod()) { // D is a local of some kind. Look into the map of local // declarations to their instantiations. |