re PR c++/50303 ([C++0x] Segfault with variadic template template parameters)
authorJason Merrill <jason@redhat.com>
Tue, 17 Apr 2012 02:29:27 +0000 (22:29 -0400)
committerJason Merrill <jason@gcc.gnu.org>
Tue, 17 Apr 2012 02:29:27 +0000 (22:29 -0400)
PR c++/50303
* pt.c (tsubst_pack_expansion): Use tsubst_expr for template
template parameters.

From-SVN: r186519

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

index 71cf71c060611f9223cba0a678a9ebafae7b97fd..3f2b999116197828fd69a6b5dd11f879ba36cc2d 100644 (file)
@@ -1,3 +1,9 @@
+2012-04-16  Jason Merrill  <jason@redhat.com>
+
+       PR c++/50303
+       * pt.c (tsubst_pack_expansion): Use tsubst_expr for template
+       template parameters.
+
 2012-04-16  Paolo Carlini  <paolo.carlini@oracle.com>
 
        PR c++/49152
index 95d0aba0534ce6234c2638ccdb159d52d6848aaa..742378179a2e55d9f57b3538f9b2af3c0fe43b50 100644 (file)
@@ -9518,7 +9518,7 @@ tsubst_pack_expansion (tree t, tree args, tsubst_flags_t complain,
         }
 
       /* Substitute into the PATTERN with the altered arguments.  */
-      if (TREE_CODE (t) == EXPR_PACK_EXPANSION)
+      if (!TYPE_P (pattern))
         TREE_VEC_ELT (result, i) = 
           tsubst_expr (pattern, args, complain, in_decl,
                        /*integral_constant_expression_p=*/false);
index 79a724ebb9c72aa5644db816232e0d468aa64fa8..42e33c7452ce5648ebfd14ea3a71051991c87cc1 100644 (file)
@@ -1,3 +1,8 @@
+2012-04-16  Jason Merrill  <jason@redhat.com>
+
+       PR c++/50303
+       * g++.dg/cpp0x/variadic128.C: New.
+
 2012-04-16  Tobias Burnus  <burnus@net-b.de>
 
        PR fortran/52864
diff --git a/gcc/testsuite/g++.dg/cpp0x/variadic128.C b/gcc/testsuite/g++.dg/cpp0x/variadic128.C
new file mode 100644 (file)
index 0000000..8c2d3b2
--- /dev/null
@@ -0,0 +1,16 @@
+// PR c++/50303
+// { dg-do compile { target c++11 } }
+
+template<typename Interface>
+struct A1 {
+};
+
+template<template<class I> class... Actions>
+void g2() {
+  g2<Actions...>();
+}
+
+int main()
+{
+  g2<A1>();
+}