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
diff --git a/lib/Sema/SemaTemplateDeduction.cpp b/lib/Sema/SemaTemplateDeduction.cpp
index 09bfcf5..bad30b3 100644
--- a/lib/Sema/SemaTemplateDeduction.cpp
+++ b/lib/Sema/SemaTemplateDeduction.cpp
@@ -1515,40 +1515,8 @@
= 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<NonTypeTemplateParmDecl>(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];