From a8311be2b85171e41cc82de12cdb43eaa026ce6e Mon Sep 17 00:00:00 2001 From: Douglas Gregor Date: Tue, 4 Jan 2011 23:42:36 +0000 Subject: [PATCH] Eliminate some completely useless code that attempted to perform some conversions on the substituted non-type template arguments of a class template partial specialization. C++ [temp.class.spec]p8 actually prohibits all of the cases where this code would have fired. Hey, it's better than having to deal with variadic templates here! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122852 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Sema/SemaTemplateDeduction.cpp | 32 ------------------------------ 1 file changed, 32 deletions(-) diff --git a/lib/Sema/SemaTemplateDeduction.cpp b/lib/Sema/SemaTemplateDeduction.cpp index 09bfcf5c46..bad30b3265 100644 --- a/lib/Sema/SemaTemplateDeduction.cpp +++ b/lib/Sema/SemaTemplateDeduction.cpp @@ -1515,40 +1515,8 @@ FinishTemplateArgumentDeduction(Sema &S, = ClassTemplate->getTemplateParameters(); for (unsigned I = 0, E = TemplateParams->size(); I != E; ++I) { TemplateArgument InstArg = ConvertedInstArgs.data()[I]; - Decl *Param = TemplateParams->getParam(I); - if (NonTypeTemplateParmDecl *NTTP - = dyn_cast(Param)) { - // When the argument is an expression, check the expression result - // against the actual template parameter to get down to the canonical - // template argument. - Expr *InstExpr = 0; - if (InstArg.getKind() == TemplateArgument::Expression) - InstExpr = InstArg.getAsExpr(); - else if (InstArg.getKind() == TemplateArgument::Integral) { - ExprResult InstExprFromArg - = S.BuildExpressionFromIntegralTemplateArgument(InstArg, - Info.getLocation()); - if (InstExprFromArg.isInvalid()) { - Info.Param = makeTemplateParameter(Param); - Info.FirstArg = InstArg; - return Sema::TDK_SubstitutionFailure; - } - - InstExpr = InstExprFromArg.get(); - } - - if (InstExpr) { - // FIXME: Variadic templates. - if (S.CheckTemplateArgument(NTTP, NTTP->getType(), InstExpr, InstArg)) { - Info.Param = makeTemplateParameter(Param); - Info.FirstArg = Partial->getTemplateArgs()[I]; - return Sema::TDK_SubstitutionFailure; - } - } - } - if (!isSameTemplateArg(S.Context, TemplateArgs[I], InstArg)) { Info.Param = makeTemplateParameter(Param); Info.FirstArg = TemplateArgs[I]; -- 2.50.1