From: Jason Merrill Date: Fri, 21 Feb 2014 15:29:25 +0000 (-0500) Subject: re PR c++/60219 ([c++11] ICE invalid use of variadic template) X-Git-Tag: releases/gcc-4.8.3~329 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c4347211d312b5d4a63fb2a0db2a16cb2969c5ca;p=thirdparty%2Fgcc.git re PR c++/60219 ([c++11] ICE invalid use of variadic template) PR c++/60219 * pt.c (coerce_template_parms): Bail if argument packing fails. From-SVN: r208007 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 69cf400be9f1..da19925f76f5 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,8 @@ 2014-02-21 Jason Merrill + 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. diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index 23e8c1d345c6..e6e98a4e1aa1 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -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 index 000000000000..6a30efed92c8 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/variadic150.C @@ -0,0 +1,9 @@ +// PR c++/60219 +// { dg-require-effective-target c++11 } + +template void foo(); + +void bar() +{ + foo<0>; // { dg-error "" } +}