OSDN Git Service

PR c++/48736
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 10 May 2011 17:58:38 +0000 (17:58 +0000)
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 10 May 2011 17:58:38 +0000 (17:58 +0000)
* pt.c (tsubst_copy_and_build): Handle substitution of a pack
expansion producing another expansion.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@173627 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/cp/ChangeLog
gcc/cp/pt.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp0x/variadic108.C [new file with mode: 0644]

index aa2d2f5..34359f0 100644 (file)
@@ -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.
index f6392d6..5e24977 100644 (file)
@@ -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.  */
index e133d9d..4a63e60 100644 (file)
@@ -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 (file)
index 0000000..3ad5af4
--- /dev/null
@@ -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);