Preserve type source information when substituting into FieldDecls.

llvm-svn: 84734
This commit is contained in:
John McCall 2009-10-21 02:42:37 +00:00
parent f1abcdcddd
commit c30047ae8d
1 changed files with 7 additions and 7 deletions

View File

@ -204,11 +204,11 @@ Decl *TemplateDeclInstantiator::VisitVarDecl(VarDecl *D) {
Decl *TemplateDeclInstantiator::VisitFieldDecl(FieldDecl *D) {
bool Invalid = false;
QualType T = D->getType();
if (T->isDependentType()) {
T = SemaRef.SubstType(T, TemplateArgs,
D->getLocation(), D->getDeclName());
if (!T.isNull() && T->isFunctionType()) {
DeclaratorInfo *DI = D->getDeclaratorInfo();
if (DI->getType()->isDependentType()) {
DI = SemaRef.SubstType(DI, TemplateArgs,
D->getLocation(), D->getDeclName());
if (DI && DI->getType()->isFunctionType()) {
// C++ [temp.arg.type]p3:
// If a declaration acquires a function type through a type
// dependent on a template-parameter and this causes a
@ -238,8 +238,8 @@ Decl *TemplateDeclInstantiator::VisitFieldDecl(FieldDecl *D) {
BitWidth = InstantiatedBitWidth.takeAs<Expr>();
}
FieldDecl *Field = SemaRef.CheckFieldDecl(D->getDeclName(), T,
D->getDeclaratorInfo(),
FieldDecl *Field = SemaRef.CheckFieldDecl(D->getDeclName(),
DI->getType(), DI,
cast<RecordDecl>(Owner),
D->getLocation(),
D->isMutable(),