From 1dc9acdb06dbd5f0a5747dd0ffa7ede680d7ca08 Mon Sep 17 00:00:00 2001 From: John McCall Date: Wed, 21 Oct 2009 02:50:40 +0000 Subject: [PATCH] Preserve type source information when substituting into ParmVarDecls. Apparently I'm grinding my commit count. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84735 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Sema/SemaTemplateInstantiateDecl.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/Sema/SemaTemplateInstantiateDecl.cpp b/lib/Sema/SemaTemplateInstantiateDecl.cpp index 14d8c35485..0bd4ee520c 100644 --- a/lib/Sema/SemaTemplateInstantiateDecl.cpp +++ b/lib/Sema/SemaTemplateInstantiateDecl.cpp @@ -774,23 +774,23 @@ Decl *TemplateDeclInstantiator::VisitCXXConversionDecl(CXXConversionDecl *D) { } ParmVarDecl *TemplateDeclInstantiator::VisitParmVarDecl(ParmVarDecl *D) { - QualType OrigT = SemaRef.SubstType(D->getOriginalType(), TemplateArgs, - D->getLocation(), D->getDeclName()); - if (OrigT.isNull()) + DeclaratorInfo *OrigT = SemaRef.SubstType(D->DeclaratorInfo(), TemplateArgs, + D->getLocation(), D->getDeclName()); + if (!OrigT) return 0; - QualType T = SemaRef.adjustParameterType(OrigT); + QualType T = SemaRef.adjustParameterType(OrigT->getType()); // Allocate the parameter ParmVarDecl *Param = 0; - if (T == OrigT) + if (T == OrigT->getType()) Param = ParmVarDecl::Create(SemaRef.Context, Owner, D->getLocation(), - D->getIdentifier(), T, D->getDeclaratorInfo(), + D->getIdentifier(), T, OrigT, D->getStorageClass(), 0); else Param = OriginalParmVarDecl::Create(SemaRef.Context, Owner, D->getLocation(), D->getIdentifier(), - T, D->getDeclaratorInfo(), OrigT, + T, OrigT, OrigT->getType(), D->getStorageClass(), 0); // Mark the default argument as being uninstantiated. -- 2.50.1