diff options
author | Douglas Gregor <dgregor@apple.com> | 2011-01-04 23:42:36 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2011-01-04 23:42:36 +0000 |
commit | a8311be2b85171e41cc82de12cdb43eaa026ce6e (patch) | |
tree | e9ab31b23c27d0b4a8c75426c19a209f9cf506be /lib/Sema/SemaTemplateDeduction.cpp | |
parent | 54c53cca105ed595e12fecf04e415c3712bda936 (diff) |
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
Diffstat (limited to 'lib/Sema/SemaTemplateDeduction.cpp')
-rw-r--r-- | lib/Sema/SemaTemplateDeduction.cpp | 32 |
1 files changed, 0 insertions, 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<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]; |