Commit f484a91a by Jason Merrill Committed by Jason Merrill

re PR c++/39863 ([c++0x] variadic templates : wrong error "mismatched argument pack lengths")

	PR c++/39863
	* pt.c (tsubst_pack_expansion): Don't do anything now if we
	have incomplete packs of different lengths.

From-SVN: r152537
parent 7097b3ac
2009-10-07 Jason Merrill <jason@redhat.com>
PR c++/39863
* pt.c (tsubst_pack_expansion): Don't do anything now if we
have incomplete packs of different lengths.
PR c++/41038
* tree.c (build_qualified_name): Call convert_from_reference.
......
......@@ -7944,6 +7944,10 @@ tsubst_pack_expansion (tree t, tree args, tsubst_flags_t complain,
}
else if (len != my_len)
{
if (incomplete)
/* We got explicit args for some packs but not others;
do nothing now and try again after deduction. */
return t;
if (TREE_CODE (t) == TYPE_PACK_EXPANSION)
error ("mismatched argument pack lengths while expanding "
"%<%T%>",
......
2009-10-07 Jason Merrill <jason@redhat.com>
* g++.dg/cpp0x/variadic95.C: New.
2009-10-07 Jason Merrill <jason@redhat.com>
* g++.dg/template/scope3.C: New.
2009-10-07 Jakub Jelinek <jakub@redhat.com>
......
// PR c++/39863
// { dg-options -std=c++0x }
template <typename... T>
struct A {};
template <typename T, typename U>
struct S {};
template <typename... T, typename... U>
A< S<T, U>... > f(U... u)
{ return A< S<T, U>... >(); }
int main()
{
f<int>(0.0);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment