forked from OSchip/llvm-project
Fix PR8760: IndirectFieldDecl Type was not updated during template instantiation.
llvm-svn: 121363
This commit is contained in:
parent
bc4457e317
commit
dbafc19fe0
|
@ -467,9 +467,10 @@ Decl *TemplateDeclInstantiator::VisitIndirectFieldDecl(IndirectFieldDecl *D) {
|
|||
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());
|
||||
|
||||
|
||||
|
|
|
@ -90,3 +90,16 @@ struct S {
|
|||
};
|
||||
};
|
||||
} s;
|
||||
|
||||
|
||||
//PR8760
|
||||
template <typename T>
|
||||
struct Foo {
|
||||
Foo() : ptr(__nullptr) {}
|
||||
union {
|
||||
T *ptr;
|
||||
};
|
||||
};
|
||||
Foo<int> f;
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue