Fix PR8760: IndirectFieldDecl Type was not updated during template instantiation.

llvm-svn: 121363
This commit is contained in:
Francois Pichet 2010-12-09 10:07:54 +00:00
parent bc4457e317
commit dbafc19fe0
2 changed files with 15 additions and 1 deletions

View File

@ -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());

View File

@ -90,3 +90,16 @@ struct S {
};
};
} s;
//PR8760
template <typename T>
struct Foo {
Foo() : ptr(__nullptr) {}
union {
T *ptr;
};
};
Foo<int> f;