aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaTemplateInstantiate.cpp
diff options
context:
space:
mode:
authorAnders Carlsson <andersca@mac.com>2009-08-29 19:37:28 +0000
committerAnders Carlsson <andersca@mac.com>2009-08-29 19:37:28 +0000
commit0d8df780aef1acda5962347a32591efc629b6748 (patch)
tree19447c873904b8fce613430a89503a703342046f /lib/Sema/SemaTemplateInstantiate.cpp
parent31976591dee494994f2546c72c23e1e35a9c1555 (diff)
Improve instantiation of UnresolvedUsingDecls.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80434 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaTemplateInstantiate.cpp')
-rw-r--r--lib/Sema/SemaTemplateInstantiate.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/Sema/SemaTemplateInstantiate.cpp b/lib/Sema/SemaTemplateInstantiate.cpp
index 521394b978..b1cc328a2d 100644
--- a/lib/Sema/SemaTemplateInstantiate.cpp
+++ b/lib/Sema/SemaTemplateInstantiate.cpp
@@ -477,6 +477,11 @@ TemplateInstantiator::TransformDeclRefExpr(DeclRefExpr *E) {
if (!InstD)
return SemaRef.ExprError();
+ // If we instantiated an UnresolvedUsingDecl and got back an UsingDecl,
+ // we need to get the underlying decl.
+ // FIXME: Is this correct? Maybe FindInstantiatedDecl should do this?
+ InstD = InstD->getUnderlyingDecl();
+
// FIXME: nested-name-specifier for QualifiedDeclRefExpr
return SemaRef.BuildDeclarationNameExpr(E->getLocation(), InstD,
/*FIXME:*/false,
@@ -685,6 +690,8 @@ Sema::InstantiateClass(SourceLocation PointOfInstantiation,
Invalid = true;
else if (FieldDecl *Field = dyn_cast<FieldDecl>(NewMember))
Fields.push_back(DeclPtrTy::make(Field));
+ else if (UsingDecl *UD = dyn_cast<UsingDecl>(NewMember))
+ Instantiation->addDecl(UD);
} else {
// FIXME: Eventually, a NULL return will mean that one of the
// instantiations was a semantic disaster, and we'll want to set Invalid =