summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaTemplateInstantiate.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-09-16 18:34:49 +0000
committerDouglas Gregor <dgregor@apple.com>2009-09-16 18:34:49 +0000
commit64621e6eb31a8b47a2fc04c41ada5663bbf3c3e3 (patch)
treee4180a01176341acffcdbb1e78cc328fc6418a6c /clang/lib/Sema/SemaTemplateInstantiate.cpp
parent820640d39fd1cb23aa70a167b2c11c30fc43b165 (diff)
downloadbcm5719-llvm-64621e6eb31a8b47a2fc04c41ada5663bbf3c3e3.tar.gz
bcm5719-llvm-64621e6eb31a8b47a2fc04c41ada5663bbf3c3e3.zip
Teach Sema::FindInstantiatedDecl to find instantiated RecordDecls even
when we are not instantiating the corresponding "current instantiation." This happens, e.g., when we are instantiating a declaration reference that refers into the "current instantiation" but occurs in a default function argument. The libstdc++ vector default constructor now instantiates properly. llvm-svn: 82069
Diffstat (limited to 'clang/lib/Sema/SemaTemplateInstantiate.cpp')
-rw-r--r--clang/lib/Sema/SemaTemplateInstantiate.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/clang/lib/Sema/SemaTemplateInstantiate.cpp b/clang/lib/Sema/SemaTemplateInstantiate.cpp
index 87216a072dc..86b49d4f320 100644
--- a/clang/lib/Sema/SemaTemplateInstantiate.cpp
+++ b/clang/lib/Sema/SemaTemplateInstantiate.cpp
@@ -429,7 +429,7 @@ Decl *TemplateInstantiator::TransformDecl(Decl *D) {
"Reducing depth of template template parameters is not yet implemented");
}
- return SemaRef.FindInstantiatedDecl(cast<NamedDecl>(D));
+ return SemaRef.FindInstantiatedDecl(cast<NamedDecl>(D), TemplateArgs);
}
Decl *TemplateInstantiator::TransformDefinition(Decl *D) {
@@ -533,7 +533,8 @@ TemplateInstantiator::TransformDeclRefExpr(DeclRefExpr *E) {
if (Arg.getKind() == TemplateArgument::Declaration) {
ValueDecl *VD = cast<ValueDecl>(Arg.getAsDecl());
- VD = cast_or_null<ValueDecl>(getSema().FindInstantiatedDecl(VD));
+ VD = cast_or_null<ValueDecl>(
+ getSema().FindInstantiatedDecl(VD, TemplateArgs));
if (!VD)
return SemaRef.ExprError();
@@ -562,7 +563,7 @@ TemplateInstantiator::TransformDeclRefExpr(DeclRefExpr *E) {
E->getSourceRange().getBegin()));
}
- NamedDecl *InstD = SemaRef.FindInstantiatedDecl(D);
+ NamedDecl *InstD = SemaRef.FindInstantiatedDecl(D, TemplateArgs);
if (!InstD)
return SemaRef.ExprError();
OpenPOWER on IntegriCloud