diff options
author | Douglas Gregor <dgregor@apple.com> | 2009-06-30 15:47:41 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2009-06-30 15:47:41 +0000 |
commit | 751f9a416a94fe723e6c34fc15fff2ccdf1c4be9 (patch) | |
tree | 7a1f048f5351a034932de0b7ec8a24559a6f3b28 /lib/Sema/SemaTemplateInstantiateExpr.cpp | |
parent | ce2f9bd2bc7dd4e070d46114b6a921127bd1ca86 (diff) |
Refactor ActOnDeclarationNameExpr into a "parsing action" part and a
"semantic analysis" part. Use the "semantic analysis" part when
performing template instantiation on a DeclRefExpr, rather than an ad
hoc list of rules to construct DeclRefExprs from the instantiation.
A test case for this change will come in with a large commit, which
illustrates what I was actually trying to work on.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74528 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaTemplateInstantiateExpr.cpp')
-rw-r--r-- | lib/Sema/SemaTemplateInstantiateExpr.cpp | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/lib/Sema/SemaTemplateInstantiateExpr.cpp b/lib/Sema/SemaTemplateInstantiateExpr.cpp index e1702b52a6..719a9eda47 100644 --- a/lib/Sema/SemaTemplateInstantiateExpr.cpp +++ b/lib/Sema/SemaTemplateInstantiateExpr.cpp @@ -156,18 +156,15 @@ TemplateExprInstantiator::VisitDeclRefExpr(DeclRefExpr *E) { false, false)); } - ValueDecl *NewD - = dyn_cast_or_null<ValueDecl>(SemaRef.InstantiateCurrentDeclRef(D)); - if (!NewD) + NamedDecl *InstD = SemaRef.InstantiateCurrentDeclRef(D); + if (!InstD) return SemaRef.ExprError(); - // FIXME: Build QualifiedDeclRefExpr? - QualType T = NewD->getType(); - return SemaRef.Owned(new (SemaRef.Context) DeclRefExpr(NewD, - T.getNonReferenceType(), - E->getLocation(), - T->isDependentType(), - T->isDependentType())); + // FIXME: nested-name-specifier for QualifiedDeclRefExpr + return SemaRef.BuildDeclarationNameExpr(E->getLocation(), InstD, + /*FIXME:*/false, + /*FIXME:*/0, + /*FIXME:*/false); } Sema::OwningExprResult |