diff options
author | Douglas Gregor <dgregor@apple.com> | 2011-01-05 21:00:53 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2011-01-05 21:00:53 +0000 |
commit | f491ee2ea68585b7facadc03d4b7440e59e0bd81 (patch) | |
tree | b5fd77646c41c1b5228a32ec4c51c573ed376c29 /clang/lib/Sema/SemaTemplateDeduction.cpp | |
parent | 51bc571955ed5b7feef8a16ce173d012ff04c5a0 (diff) | |
download | bcm5719-llvm-f491ee2ea68585b7facadc03d4b7440e59e0bd81.tar.gz bcm5719-llvm-f491ee2ea68585b7facadc03d4b7440e59e0bd81.zip |
Propagate the "deduced from array bound" bit when comparing deduced
template argument packs. Plus, remove a FIXME that I fixed yesterday.
llvm-svn: 122903
Diffstat (limited to 'clang/lib/Sema/SemaTemplateDeduction.cpp')
-rw-r--r-- | clang/lib/Sema/SemaTemplateDeduction.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/clang/lib/Sema/SemaTemplateDeduction.cpp b/clang/lib/Sema/SemaTemplateDeduction.cpp index f6dacc7ceae..0df2899855c 100644 --- a/clang/lib/Sema/SemaTemplateDeduction.cpp +++ b/clang/lib/Sema/SemaTemplateDeduction.cpp @@ -228,8 +228,10 @@ checkDeducedTemplateArguments(ASTContext &Context, XAEnd = X.pack_end(), YA = Y.pack_begin(); XA != XAEnd; ++XA, ++YA) { - // FIXME: We've lost the "deduced from array bound" bit. - if (checkDeducedTemplateArguments(Context, *XA, *YA).isNull()) + if (checkDeducedTemplateArguments(Context, + DeducedTemplateArgument(*XA, X.wasDeducedFromArrayBound()), + DeducedTemplateArgument(*YA, Y.wasDeducedFromArrayBound())) + .isNull()) return DeducedTemplateArgument(); } @@ -1400,7 +1402,7 @@ static bool ConvertDeducedTemplateArgument(Sema &S, NamedDecl *Param, // the template parameter. llvm::SmallVector<TemplateArgument, 2> PackedArgsBuilder; for (TemplateArgument::pack_iterator PA = Arg.pack_begin(), - PAEnd = Arg.pack_end(); + PAEnd = Arg.pack_end(); PA != PAEnd; ++PA) { // When converting the deduced template argument, append it to the // general output list. We need to do this so that the template argument @@ -1522,8 +1524,6 @@ FinishTemplateArgumentDeduction(Sema &S, // verify that the instantiated template arguments are both valid // and are equivalent to the template arguments originally provided // to the class template. - // FIXME: Do we have to correct the types of deduced non-type template - // arguments (in particular, integral non-type template arguments?). LocalInstantiationScope InstScope(S); ClassTemplateDecl *ClassTemplate = Partial->getSpecializedTemplate(); const TemplateArgumentLoc *PartialTemplateArgs |