From 598da5b01fa9e205f55db8b3b5cb20abec2d74cf Mon Sep 17 00:00:00 2001 From: Anders Carlsson Date: Sat, 29 Aug 2009 01:06:32 +0000 Subject: [PATCH] CreateDeclRefExprs that point to UnresolvedUsingDecls. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80413 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Sema/SemaExpr.cpp | 5 +++++ test/SemaCXX/using-decl-templates.cpp | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp index 91c1fa5a12..474ddf0635 100644 --- a/lib/Sema/SemaExpr.cpp +++ b/lib/Sema/SemaExpr.cpp @@ -1036,6 +1036,11 @@ Sema::BuildDeclarationNameExpr(SourceLocation Loc, NamedDecl *D, else if (TemplateDecl *Template = dyn_cast(D)) return BuildDeclRefExpr(Template, Context.OverloadTy, Loc, false, false, SS); + else if (UnresolvedUsingDecl *UD = dyn_cast(D)) + return BuildDeclRefExpr(UD, Context.DependentTy, Loc, + /*TypeDependent=*/true, + /*ValueDependent=*/true, SS); + ValueDecl *VD = cast(D); // Check whether this declaration can be used. Note that we suppress diff --git a/test/SemaCXX/using-decl-templates.cpp b/test/SemaCXX/using-decl-templates.cpp index 42442e2860..1a53704c1e 100644 --- a/test/SemaCXX/using-decl-templates.cpp +++ b/test/SemaCXX/using-decl-templates.cpp @@ -28,3 +28,9 @@ template struct D : A { }; template void D::f() { } + +template struct E : A { + using A::f; + + void g() { f(); } +}; -- 2.40.0