diff options
author | Douglas Gregor <dgregor@apple.com> | 2009-09-03 21:38:09 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2009-09-03 21:38:09 +0000 |
commit | c68afe2cbe7f875a9243c411077602fb5f5dc74b (patch) | |
tree | 04412391650d20f0e45473601ed7d5f5ad8fe44e /lib/Sema/SemaTemplateInstantiate.cpp | |
parent | 9d436205be3e4c05854530134be61b46b13136ff (diff) |
Improve template instantiation for member access expressions that
involve qualified names, e.g., x->Base::f. We now maintain enough
information in the AST to compare the results of the name lookup of
"Base" in the scope of the postfix-expression (determined at template
definition time) and in the type of the object expression.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80953 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaTemplateInstantiate.cpp')
-rw-r--r-- | lib/Sema/SemaTemplateInstantiate.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/Sema/SemaTemplateInstantiate.cpp b/lib/Sema/SemaTemplateInstantiate.cpp index c03f2e19aa..0c47e996c8 100644 --- a/lib/Sema/SemaTemplateInstantiate.cpp +++ b/lib/Sema/SemaTemplateInstantiate.cpp @@ -359,8 +359,10 @@ namespace { } Decl *TemplateInstantiator::TransformDecl(Decl *D) { - if (TemplateTemplateParmDecl *TTP - = dyn_cast_or_null<TemplateTemplateParmDecl>(D)) { + if (!D) + return 0; + + if (TemplateTemplateParmDecl *TTP = dyn_cast<TemplateTemplateParmDecl>(D)) { if (TTP->getDepth() < TemplateArgs.getNumLevels()) { assert(TemplateArgs(TTP->getDepth(), TTP->getPosition()).getAsDecl() && "Wrong kind of template template argument"); @@ -381,7 +383,7 @@ Decl *TemplateInstantiator::TransformDecl(Decl *D) { "Reducing depth of template template parameters is not yet implemented"); } - return SemaRef.FindInstantiatedDecl(cast_or_null<NamedDecl>(D)); + return SemaRef.FindInstantiatedDecl(cast<NamedDecl>(D)); } Decl *TemplateInstantiator::TransformDefinition(Decl *D) { |