Fix PR8760: IndirectFieldDecl Type was not updated during template instantiation.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121363 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaTemplateInstantiateDecl.cpp b/lib/Sema/SemaTemplateInstantiateDecl.cpp
index e3b8cfe..f98efec 100644
--- a/lib/Sema/SemaTemplateInstantiateDecl.cpp
+++ b/lib/Sema/SemaTemplateInstantiateDecl.cpp
@@ -467,9 +467,10 @@
NamedChain[i++] = (SemaRef.FindInstantiatedDecl(D->getLocation(),
*PI, TemplateArgs));
+ QualType T = cast<FieldDecl>(NamedChain[i-1])->getType();
IndirectFieldDecl* IndirectField
= IndirectFieldDecl::Create(SemaRef.Context, Owner, D->getLocation(),
- D->getIdentifier(), D->getType(),
+ D->getIdentifier(), T,
NamedChain, D->getChainingSize());