]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR c++/60219 ([c++11] ICE invalid use of variadic template)
authorJason Merrill <jason@redhat.com>
Fri, 21 Feb 2014 15:29:25 +0000 (10:29 -0500)
committerJason Merrill <jason@gcc.gnu.org>
Fri, 21 Feb 2014 15:29:25 +0000 (10:29 -0500)
PR c++/60219
* pt.c (coerce_template_parms): Bail if argument packing fails.

From-SVN: r208007

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

index 69cf400be9f1329287d1ae4ba90fe0f15244aa19..da19925f76f519a5191063c590289a8d3a27551d 100644 (file)
@@ -1,5 +1,8 @@
 2014-02-21  Jason Merrill  <jason@redhat.com>
 
+       PR c++/60219
+       * pt.c (coerce_template_parms): Bail if argument packing fails.
+
        PR c++/60248
        * mangle.c (mangle_decl): Don't make an alias for a TYPE_DECL.
 
index 23e8c1d345c6bb53d5b5fbabac0809016e1f686c..e6e98a4e1aa130b373368987e29c543d7197da6a 100644 (file)
@@ -6677,6 +6677,8 @@ coerce_template_parms (tree parms,
           /* Store this argument.  */
           if (arg == error_mark_node)
             lost++;
+         if (lost)
+           break;
           TREE_VEC_ELT (new_inner_args, parm_idx) = arg;
 
          /* We are done with all of the arguments.  */
diff --git a/gcc/testsuite/g++.dg/cpp0x/variadic150.C b/gcc/testsuite/g++.dg/cpp0x/variadic150.C
new file mode 100644 (file)
index 0000000..6a30efe
--- /dev/null
@@ -0,0 +1,9 @@
+// PR c++/60219
+// { dg-require-effective-target c++11 }
+
+template<typename..., int> void foo();
+
+void bar()
+{
+  foo<0>;                      // { dg-error "" }
+}