diff options
author | Anders Carlsson <andersca@mac.com> | 2009-08-29 19:37:28 +0000 |
---|---|---|
committer | Anders Carlsson <andersca@mac.com> | 2009-08-29 19:37:28 +0000 |
commit | 4bb87ce33e80efe4c01c7f94d9681bbeef5c92d9 (patch) | |
tree | e0e7bef03297962b09309334490ed7f5b1b04c8f /clang/lib/Sema/SemaTemplateInstantiate.cpp | |
parent | 3df87678694de01bb51851f3555629a869627c26 (diff) | |
download | bcm5719-llvm-4bb87ce33e80efe4c01c7f94d9681bbeef5c92d9.tar.gz bcm5719-llvm-4bb87ce33e80efe4c01c7f94d9681bbeef5c92d9.zip |
Improve instantiation of UnresolvedUsingDecls.
llvm-svn: 80434
Diffstat (limited to 'clang/lib/Sema/SemaTemplateInstantiate.cpp')
-rw-r--r-- | clang/lib/Sema/SemaTemplateInstantiate.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaTemplateInstantiate.cpp b/clang/lib/Sema/SemaTemplateInstantiate.cpp index 521394b978a..b1cc328a2d4 100644 --- a/clang/lib/Sema/SemaTemplateInstantiate.cpp +++ b/clang/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 = |