forked from OSchip/llvm-project
Preserve source information when substituting into VarDecls.
llvm-svn: 84733
This commit is contained in:
parent
5b5cb92816
commit
f1abcdcddd
|
@ -123,16 +123,17 @@ Decl *TemplateDeclInstantiator::VisitTypedefDecl(TypedefDecl *D) {
|
|||
|
||||
Decl *TemplateDeclInstantiator::VisitVarDecl(VarDecl *D) {
|
||||
// Do substitution on the type of the declaration
|
||||
QualType T = SemaRef.SubstType(D->getType(), TemplateArgs,
|
||||
D->getTypeSpecStartLoc(),
|
||||
D->getDeclName());
|
||||
if (T.isNull())
|
||||
DeclaratorInfo *DI = SemaRef.SubstType(D->getDeclaratorInfo(),
|
||||
TemplateArgs,
|
||||
D->getTypeSpecStartLoc(),
|
||||
D->getDeclName());
|
||||
if (!DI)
|
||||
return 0;
|
||||
|
||||
// Build the instantiated declaration
|
||||
VarDecl *Var = VarDecl::Create(SemaRef.Context, Owner,
|
||||
D->getLocation(), D->getIdentifier(),
|
||||
T, D->getDeclaratorInfo(),
|
||||
DI->getType(), DI,
|
||||
D->getStorageClass());
|
||||
Var->setThreadSpecified(D->isThreadSpecified());
|
||||
Var->setCXXDirectInitializer(D->hasCXXDirectInitializer());
|
||||
|
|
Loading…
Reference in New Issue