diff options
author | Douglas Gregor <dgregor@apple.com> | 2010-05-07 23:12:07 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2010-05-07 23:12:07 +0000 |
commit | b4eeaff1595b7d0a8fbc2b3c8bec7dc63f48b7fd (patch) | |
tree | 52c512474b2f51e20585f53e69b876629be44884 /lib/Sema/SemaTemplateInstantiateDecl.cpp | |
parent | f4e54a2ddf50d81cb761be12ec1381a9f77a9ea9 (diff) |
When we encounter a non-dependent type during template instantiation,
mark any declarations we see inside of that type as
"referenced". Fixes PR7079.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103323 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaTemplateInstantiateDecl.cpp')
-rw-r--r-- | lib/Sema/SemaTemplateInstantiateDecl.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/Sema/SemaTemplateInstantiateDecl.cpp b/lib/Sema/SemaTemplateInstantiateDecl.cpp index 44bce7976c..a32c0e1ac3 100644 --- a/lib/Sema/SemaTemplateInstantiateDecl.cpp +++ b/lib/Sema/SemaTemplateInstantiateDecl.cpp @@ -191,6 +191,8 @@ Decl *TemplateDeclInstantiator::VisitTypedefDecl(TypedefDecl *D) { Invalid = true; DI = SemaRef.Context.getTrivialTypeSourceInfo(SemaRef.Context.IntTy); } + } else { + SemaRef.MarkDeclarationsReferencedInType(D->getLocation(), DI->getType()); } // Create the new typedef @@ -440,6 +442,8 @@ Decl *TemplateDeclInstantiator::VisitFieldDecl(FieldDecl *D) { << DI->getType(); Invalid = true; } + } else { + SemaRef.MarkDeclarationsReferencedInType(D->getLocation(), DI->getType()); } Expr *BitWidth = D->getBitWidth(); |