re PR c++/50830 ([c++0x] Variadic template, inner class error)
authorJason Merrill <jason@redhat.com>
Tue, 17 Apr 2012 02:29:35 +0000 (22:29 -0400)
committerJason Merrill <jason@gcc.gnu.org>
Tue, 17 Apr 2012 02:29:35 +0000 (22:29 -0400)
PR c++/50830
* pt.c (convert_template_argument): Handle template template
argument packs.

From-SVN: r186520

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

index 3f2b999116197828fd69a6b5dd11f879ba36cc2d..24ce8e0cd6bcb3232dbcd55121f18715babd4af8 100644 (file)
@@ -1,5 +1,9 @@
 2012-04-16  Jason Merrill  <jason@redhat.com>
 
+       PR c++/50830
+       * pt.c (convert_template_argument): Handle template template
+       argument packs.
+
        PR c++/50303
        * pt.c (tsubst_pack_expansion): Use tsubst_expr for template
        template parameters.
index 742378179a2e55d9f57b3538f9b2af3c0fe43b50..fcefc943376d8f07df042b58e6c94fb04e5e513e 100644 (file)
@@ -6428,6 +6428,7 @@ convert_template_argument (tree parm,
   is_tmpl_type = 
     ((TREE_CODE (arg) == TEMPLATE_DECL
       && TREE_CODE (DECL_TEMPLATE_RESULT (arg)) == TYPE_DECL)
+     || (requires_tmpl_type && TREE_CODE (arg) == TYPE_ARGUMENT_PACK)
      || TREE_CODE (arg) == TEMPLATE_TEMPLATE_PARM
      || TREE_CODE (arg) == UNBOUND_CLASS_TEMPLATE);
 
@@ -6499,7 +6500,9 @@ convert_template_argument (tree parm,
     {
       if (requires_tmpl_type)
        {
-         if (TREE_CODE (TREE_TYPE (arg)) == UNBOUND_CLASS_TEMPLATE)
+         if (template_parameter_pack_p (parm) && ARGUMENT_PACK_P (orig_arg))
+           val = orig_arg;
+         else if (TREE_CODE (TREE_TYPE (arg)) == UNBOUND_CLASS_TEMPLATE)
            /* The number of argument required is not known yet.
               Just accept it for now.  */
            val = TREE_TYPE (arg);
index 42e33c7452ce5648ebfd14ea3a71051991c87cc1..1ced5be65fb70c97fcb625c119f38c876ebd201b 100644 (file)
@@ -1,5 +1,8 @@
 2012-04-16  Jason Merrill  <jason@redhat.com>
 
+       PR c++/50830
+       * g++.dg/cpp0x/variadic129.C: New.
+
        PR c++/50303
        * g++.dg/cpp0x/variadic128.C: New.
 
diff --git a/gcc/testsuite/g++.dg/cpp0x/variadic129.C b/gcc/testsuite/g++.dg/cpp0x/variadic129.C
new file mode 100644 (file)
index 0000000..7118301
--- /dev/null
@@ -0,0 +1,19 @@
+// PR c++/50830
+// { dg-do compile { target c++11 } }
+
+template<template<class> class...>
+struct list_templates {};
+
+template<class>
+struct aa {};
+
+template<class... T>
+struct test {};
+
+template<template<class> class... F, class T>
+struct test<list_templates<F...>, T>
+{
+    struct inner {};
+};
+
+test<list_templates<aa>, int> a4; // error