[cfe-commits] r122903 - /cfe/trunk/lib/Sema/SemaTemplateDeduction.cpp
Douglas Gregor
dgregor at apple.com
Wed Jan 5 13:00:53 PST 2011
Author: dgregor
Date: Wed Jan 5 15:00:53 2011
New Revision: 122903
URL: http://llvm.org/viewvc/llvm-project?rev=122903&view=rev
Log:
Propagate the "deduced from array bound" bit when comparing deduced
template argument packs. Plus, remove a FIXME that I fixed yesterday.
Modified:
cfe/trunk/lib/Sema/SemaTemplateDeduction.cpp
Modified: cfe/trunk/lib/Sema/SemaTemplateDeduction.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaTemplateDeduction.cpp?rev=122903&r1=122902&r2=122903&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaTemplateDeduction.cpp (original)
+++ cfe/trunk/lib/Sema/SemaTemplateDeduction.cpp Wed Jan 5 15:00:53 2011
@@ -228,8 +228,10 @@
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 @@
// 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 @@
// 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
More information about the cfe-commits
mailing list