diff options
author | Jason Merrill <jason@redhat.com> | 2011-05-10 13:58:38 -0400 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2011-05-10 13:58:38 -0400 |
commit | b4359e45b9d1bdb218cac9d5bd311fedf1568d32 (patch) | |
tree | b833933c492b8f8e1eb7822b8ac949dac11aaa39 /gcc | |
parent | 7506ab1de576b07067bf3c0acb74f9d80ece7a86 (diff) | |
download | gcc-b4359e45b9d1bdb218cac9d5bd311fedf1568d32.zip gcc-b4359e45b9d1bdb218cac9d5bd311fedf1568d32.tar.gz gcc-b4359e45b9d1bdb218cac9d5bd311fedf1568d32.tar.bz2 |
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
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cp/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/cp/pt.c | 3 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/cpp0x/variadic108.C | 10 |
4 files changed, 22 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index aa2d2f5..34359f0 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2011-05-10 Jason Merrill <jason@redhat.com> + + PR c++/48736 + * pt.c (tsubst_copy_and_build): Handle substitution of a pack + expansion producing another expansion. + 2011-05-10 Ville Voutilainen <ville.voutilainen@gmail.com> Fixes for override/final. diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index f6392d6..5e24977 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 e133d9d..4a63e60 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2011-05-10 Jason Merrill <jason@redhat.com> + + * g++.dg/cpp0x/variadic108.C: New. + 2011-05-10 Ville Voutilainen <ville.voutilainen@gmail.com> * 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 0000000..3ad5af4 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/variadic108.C @@ -0,0 +1,10 @@ +// PR c++/48736 +// { dg-options -std=c++0x } + +template<class T> +T&& create(); + +template<class T, class... Args, + class = decltype(T{create<Args>()...}) // Line X +> +char f(int); |