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 | 2b6ca46c6b66096bc5dfc6f82c46cfb1761f4f53 (patch) | |
tree | 7881f432fe5f94b677450a7615703ef1e31e3782 /clang/lib/Sema/SemaTemplateInstantiate.cpp | |
parent | 59a1cd4a063a65983551a73dd858116fe2a01bbc (diff) | |
download | bcm5719-llvm-2b6ca46c6b66096bc5dfc6f82c46cfb1761f4f53.tar.gz bcm5719-llvm-2b6ca46c6b66096bc5dfc6f82c46cfb1761f4f53.zip |
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.
llvm-svn: 80953
Diffstat (limited to 'clang/lib/Sema/SemaTemplateInstantiate.cpp')
-rw-r--r-- | clang/lib/Sema/SemaTemplateInstantiate.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/clang/lib/Sema/SemaTemplateInstantiate.cpp b/clang/lib/Sema/SemaTemplateInstantiate.cpp index c03f2e19aab..0c47e996c8e 100644 --- a/clang/lib/Sema/SemaTemplateInstantiate.cpp +++ b/clang/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) { |