aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaTemplateInstantiate.cpp
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2009-12-08 09:08:17 +0000
committerJohn McCall <rjmccall@apple.com>2009-12-08 09:08:17 +0000
commitdbd872f273a8dbf22e089b3def6c09f0a460965d (patch)
treec8cfd035661ae13cd3d2a147a748714c0e8b9de3 /lib/Sema/SemaTemplateInstantiate.cpp
parent7c9624ba29bc700c3aa6c65c5363174a890c534e (diff)
DeclRefExpr stores a ValueDecl internally.
Template instantiation can re-use DeclRefExprs. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90848 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaTemplateInstantiate.cpp')
-rw-r--r--lib/Sema/SemaTemplateInstantiate.cpp21
1 files changed, 2 insertions, 19 deletions
diff --git a/lib/Sema/SemaTemplateInstantiate.cpp b/lib/Sema/SemaTemplateInstantiate.cpp
index 6158acbe9c..93df9cab02 100644
--- a/lib/Sema/SemaTemplateInstantiate.cpp
+++ b/lib/Sema/SemaTemplateInstantiate.cpp
@@ -782,25 +782,8 @@ TemplateInstantiator::TransformDeclRefExpr(DeclRefExpr *E,
// FindInstantiatedDecl will find it in the local instantiation scope.
}
- NamedDecl *InstD = SemaRef.FindInstantiatedDecl(D, TemplateArgs);
- if (!InstD)
- return SemaRef.ExprError();
-
- assert(!isa<UsingDecl>(InstD) && "decl ref instantiated to UsingDecl");
-
- CXXScopeSpec SS;
- NestedNameSpecifier *Qualifier = 0;
- if (E->getQualifier()) {
- Qualifier = TransformNestedNameSpecifier(E->getQualifier(),
- E->getQualifierRange());
- if (!Qualifier)
- return SemaRef.ExprError();
-
- SS.setScopeRep(Qualifier);
- SS.setRange(E->getQualifierRange());
- }
-
- return SemaRef.BuildDeclarationNameExpr(SS, E->getLocation(), InstD);
+ return TreeTransform<TemplateInstantiator>::
+ TransformDeclRefExpr(E, isAddressOfOperand);
}
Sema::OwningExprResult TemplateInstantiator::TransformCXXDefaultArgExpr(