[cfe-commits] r84735 - /cfe/trunk/lib/Sema/SemaTemplateInstantiateDecl.cpp
John McCall
rjmccall at apple.com
Tue Oct 20 19:50:41 PDT 2009
Author: rjmccall
Date: Tue Oct 20 21:50:40 2009
New Revision: 84735
URL: http://llvm.org/viewvc/llvm-project?rev=84735&view=rev
Log:
Preserve type source information when substituting into ParmVarDecls.
Apparently I'm grinding my commit count.
Modified:
cfe/trunk/lib/Sema/SemaTemplateInstantiateDecl.cpp
Modified: cfe/trunk/lib/Sema/SemaTemplateInstantiateDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaTemplateInstantiateDecl.cpp?rev=84735&r1=84734&r2=84735&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaTemplateInstantiateDecl.cpp (original)
+++ cfe/trunk/lib/Sema/SemaTemplateInstantiateDecl.cpp Tue Oct 20 21:50:40 2009
@@ -774,23 +774,23 @@
}
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.
More information about the cfe-commits
mailing list