From b4359e45b9d1bdb218cac9d5bd311fedf1568d32 Mon Sep 17 00:00:00 2001 From: Jason Merrill Date: Tue, 10 May 2011 13:58:38 -0400 Subject: [PATCH] re PR c++/48736 ([C++0x] ICE during list-initialization with variadics) PR c++/48736 * pt.c (tsubst_copy_and_build): Handle substitution of a pack expansion producing another expansion. From-SVN: r173627 --- gcc/cp/ChangeLog | 6 ++++++ gcc/cp/pt.c | 3 ++- gcc/testsuite/ChangeLog | 4 ++++ gcc/testsuite/g++.dg/cpp0x/variadic108.C | 10 ++++++++++ 4 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/g++.dg/cpp0x/variadic108.C diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index aa2d2f51c36..34359f01fde 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2011-05-10 Jason Merrill + + PR c++/48736 + * pt.c (tsubst_copy_and_build): Handle substitution of a pack + expansion producing another expansion. + 2011-05-10 Ville Voutilainen Fixes for override/final. diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index f6392d63b81..5e2497796fd 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -13250,7 +13250,8 @@ tsubst_copy_and_build (tree t, ce->value = tsubst_pack_expansion (ce->value, args, complain, in_decl); - if (ce->value == error_mark_node) + if (ce->value == error_mark_node + || PACK_EXPANSION_P (ce->value)) ; else if (TREE_VEC_LENGTH (ce->value) == 1) /* Just move the argument into place. */ diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index e133d9d7da0..4a63e60e144 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2011-05-10 Jason Merrill + + * g++.dg/cpp0x/variadic108.C: New. + 2011-05-10 Ville Voutilainen * g++.dg/inherit/virtual9.C: Extend. diff --git a/gcc/testsuite/g++.dg/cpp0x/variadic108.C b/gcc/testsuite/g++.dg/cpp0x/variadic108.C new file mode 100644 index 00000000000..3ad5af45717 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/variadic108.C @@ -0,0 +1,10 @@ +// PR c++/48736 +// { dg-options -std=c++0x } + +template +T&& create(); + +template()...}) // Line X +> +char f(int); -- 2.30.2