]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR c++/64514 (Error in template instantiation in GCC 4.9, works fine in GCC 4.8)
authorJason Merrill <jason@redhat.com>
Wed, 28 Jan 2015 17:21:06 +0000 (12:21 -0500)
committerJason Merrill <jason@gcc.gnu.org>
Wed, 28 Jan 2015 17:21:06 +0000 (12:21 -0500)
PR c++/64514
* pt.c (coerce_template_parameter_pack): Return NULL for a
zero-length fixed parameter pack with a pack expansion arg.

From-SVN: r220210

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

index 8fcbbe65352043a480ad3534515ca27feaeac20b..f139e621a08dff1a3b42d0f33ef946ea027aaee8 100644 (file)
@@ -1,3 +1,9 @@
+2015-01-13  Jason Merrill  <jason@redhat.com>
+
+       PR c++/64514
+       * pt.c (coerce_template_parameter_pack): Return NULL for a
+       zero-length fixed parameter pack with a pack expansion arg.
+
 2015-01-07  Jason Merrill  <jason@redhat.com>
 
        PR c++/64487
index 699ae69175c638ea9ec66d9b8dcf5bf4ead53667..2abfc70ef6dfdf7c223d2474a1218e1ff5432ea0 100644 (file)
@@ -6671,6 +6671,9 @@ coerce_template_parameter_pack (tree parms,
               if (invalid_nontype_parm_type_p (t, complain))
                 return error_mark_node;
             }
+         /* We don't know how many args we have yet, just
+            use the unconverted ones for now.  */
+         return NULL_TREE;
         }
 
       packed_args = make_tree_vec (TREE_VEC_LENGTH (packed_parms));
diff --git a/gcc/testsuite/g++.dg/cpp0x/variadic165.C b/gcc/testsuite/g++.dg/cpp0x/variadic165.C
new file mode 100644 (file)
index 0000000..862931f
--- /dev/null
@@ -0,0 +1,17 @@
+// PR c++/64514
+// { dg-do compile { target c++11 } }
+
+template<typename... T>
+struct Functor
+{
+    template <T...>
+    struct Inner
+    {};
+};
+
+template struct Functor<>::Inner<>;
+
+int main()
+{
+
+}