PR c++/61022 - error with variadic template template parm
authorJason Merrill <jason@redhat.com>
Wed, 28 Jun 2017 19:59:44 +0000 (15:59 -0400)
committerJason Merrill <jason@gcc.gnu.org>
Wed, 28 Jun 2017 19:59:44 +0000 (15:59 -0400)
* pt.c (convert_template_argument): Keep the TYPE_PACK_EXPANSION.

From-SVN: r249756

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

index ae6de7f009c2cae73085f38a915b7401c2398233..9c21f6f363e5ebe1d7f89165cc5a1286c5a1ae85 100644 (file)
@@ -1,5 +1,8 @@
 2017-06-28  Jason Merrill  <jason@redhat.com>
 
+       PR c++/61022 - error with variadic template template parm
+       * pt.c (convert_template_argument): Keep the TYPE_PACK_EXPANSION.
+
        PR c++/72801 - ICE with variadic partial specialization
        * pt.c (unify_pack_expansion): Use PACK_EXPANSION_EXTRA_ARGS.
 
index b86b346164d9fb2ebffe982be39905ee3168ece8..fa75037aa3da24f266e085ac10d30a822c40b100 100644 (file)
@@ -7695,7 +7695,7 @@ convert_template_argument (tree parm,
          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);
+           val = orig_arg;
          else
            {
              tree parmparm = DECL_INNERMOST_TEMPLATE_PARMS (parm);
diff --git a/gcc/testsuite/g++.dg/cpp0x/variadic-ttp8.C b/gcc/testsuite/g++.dg/cpp0x/variadic-ttp8.C
new file mode 100644 (file)
index 0000000..f3e576a
--- /dev/null
@@ -0,0 +1,27 @@
+// PR c++/69111
+// { dg-do compile { target c++11 } }
+
+template <template <typename> class ...>
+struct template_list {};
+
+template <typename T>
+struct A
+{};
+
+template <typename>
+struct B
+{
+ template <typename T>
+ using type = A<T>;
+};
+
+template <typename ... Types>
+struct C
+{
+ using type = template_list<B<Types>::template type...>;
+};
+
+int main()
+{
+ return 0;
+}