summaryrefslogtreecommitdiffstats
path: root/clang/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
commitce54657e956ec91a1e81596beeb44933dda03f8c (patch)
treebdc30a5b8b3f4265795fbdbd278c64b8a4741418 /clang/lib/Sema/SemaTemplateInstantiate.cpp
parentfe2f901269a9744aaece1b6c322b86223aa2b0d6 (diff)
downloadbcm5719-llvm-ce54657e956ec91a1e81596beeb44933dda03f8c.tar.gz
bcm5719-llvm-ce54657e956ec91a1e81596beeb44933dda03f8c.zip
DeclRefExpr stores a ValueDecl internally.
Template instantiation can re-use DeclRefExprs. llvm-svn: 90848
Diffstat (limited to 'clang/lib/Sema/SemaTemplateInstantiate.cpp')
-rw-r--r--clang/lib/Sema/SemaTemplateInstantiate.cpp21
1 files changed, 2 insertions, 19 deletions
diff --git a/clang/lib/Sema/SemaTemplateInstantiate.cpp b/clang/lib/Sema/SemaTemplateInstantiate.cpp
index 6158acbe9c9..93df9cab024 100644
--- a/clang/lib/Sema/SemaTemplateInstantiate.cpp
+++ b/clang/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(
OpenPOWER on IntegriCloud