]> granicus.if.org Git - clang/commitdiff
Preserve type source information when substituting into ParmVarDecls.
authorJohn McCall <rjmccall@apple.com>
Wed, 21 Oct 2009 02:50:40 +0000 (02:50 +0000)
committerJohn McCall <rjmccall@apple.com>
Wed, 21 Oct 2009 02:50:40 +0000 (02:50 +0000)
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

index 14d8c35485f29280db96c645e552e98b167c3705..0bd4ee520cf9952114b71bf16df21fd8a8062bfb 100644 (file)
@@ -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.