summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaTemplateInstantiate.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-05-07 23:12:07 +0000
committerDouglas Gregor <dgregor@apple.com>2010-05-07 23:12:07 +0000
commit5597ab4076e2bbd8972c9328f79cd1ca9fea17ce (patch)
tree94bceb6d54dffda74c6930369b06b2c24395ae85 /clang/lib/Sema/SemaTemplateInstantiate.cpp
parent6b5897b4de5683967f2bfe37413aaf4668185584 (diff)
downloadbcm5719-llvm-5597ab4076e2bbd8972c9328f79cd1ca9fea17ce.tar.gz
bcm5719-llvm-5597ab4076e2bbd8972c9328f79cd1ca9fea17ce.zip
When we encounter a non-dependent type during template instantiation,
mark any declarations we see inside of that type as "referenced". Fixes PR7079. llvm-svn: 103323
Diffstat (limited to 'clang/lib/Sema/SemaTemplateInstantiate.cpp')
-rw-r--r--clang/lib/Sema/SemaTemplateInstantiate.cpp15
1 files changed, 12 insertions, 3 deletions
diff --git a/clang/lib/Sema/SemaTemplateInstantiate.cpp b/clang/lib/Sema/SemaTemplateInstantiate.cpp
index c7489ad8210..7dab4bd8bd5 100644
--- a/clang/lib/Sema/SemaTemplateInstantiate.cpp
+++ b/clang/lib/Sema/SemaTemplateInstantiate.cpp
@@ -560,9 +560,7 @@ namespace {
///
/// For the purposes of template instantiation, a type has already been
/// transformed if it is NULL or if it is not dependent.
- bool AlreadyTransformed(QualType T) {
- return T.isNull() || !T->isDependentType();
- }
+ bool AlreadyTransformed(QualType T);
/// \brief Returns the location of the entity being instantiated, if known.
SourceLocation getBaseLocation() { return Loc; }
@@ -624,6 +622,17 @@ namespace {
};
}
+bool TemplateInstantiator::AlreadyTransformed(QualType T) {
+ if (T.isNull())
+ return true;
+
+ if (T->isDependentType())
+ return false;
+
+ getSema().MarkDeclarationsReferencedInType(Loc, T);
+ return true;
+}
+
Decl *TemplateInstantiator::TransformDecl(SourceLocation Loc, Decl *D) {
if (!D)
return 0;
OpenPOWER on IntegriCloud