@@ -3083,8 +3083,7 @@ static TemplateDeductionResult ConvertDeducedTemplateArguments(
30833083
30843084 // If there was no default argument, deduction is incomplete.
30853085 if (DefArg.getArgument ().isNull ()) {
3086- Info.Param = makeTemplateParameter (
3087- const_cast <NamedDecl *>(TemplateParams->getParam (I)));
3086+ Info.Param = makeTemplateParameter (TemplateParams->getParam (I));
30883087 Info.reset (
30893088 TemplateArgumentList::CreateCopy (S.Context , CTAI.SugaredConverted ),
30903089 TemplateArgumentList::CreateCopy (S.Context , CTAI.CanonicalConverted ));
@@ -3100,8 +3099,7 @@ static TemplateDeductionResult ConvertDeducedTemplateArguments(
31003099 if (S.CheckTemplateArgument (
31013100 Param, DefArg, TD, TD->getLocation (), TD->getSourceRange ().getEnd (),
31023101 /* ArgumentPackIndex=*/ 0 , CTAI, Sema::CTAK_Specified)) {
3103- Info.Param = makeTemplateParameter (
3104- const_cast <NamedDecl *>(TemplateParams->getParam (I)));
3102+ Info.Param = makeTemplateParameter (TemplateParams->getParam (I));
31053103 // FIXME: These template arguments are temporary. Free them!
31063104 Info.reset (
31073105 TemplateArgumentList::CreateCopy (S.Context , CTAI.SugaredConverted ),
@@ -3227,7 +3225,7 @@ static TemplateDeductionResult FinishTemplateArgumentDeduction(
32273225 if (ParamIdx >= TPL->size ())
32283226 ParamIdx = TPL->size () - 1 ;
32293227
3230- Decl *Param = const_cast <NamedDecl *>( TPL->getParam (ParamIdx) );
3228+ Decl *Param = TPL->getParam (ParamIdx);
32313229 Info.Param = makeTemplateParameter (Param);
32323230 Info.FirstArg = Ps[ArgIdx].getArgument ();
32333231 return TemplateDeductionResult::SubstitutionFailure;
0 commit comments