From: Jason Merrill Date: Fri, 21 Feb 2014 14:57:00 +0000 (-0500) Subject: re PR c++/60219 ([c++11] ICE invalid use of variadic template) X-Git-Tag: releases/gcc-4.9.0~771 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=07874b2486b101bd807dd183326da3e7d064de7a;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: r208003 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 62aacd62e81b..9ddd8f81bc89 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++/60224 * decl.c (cp_complete_array_type, maybe_deduce_size_from_array_init): Don't get confused by a CONSTRUCTOR that already has a type. diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index 0f576a52aea2..bf41e8650984 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -6808,6 +6808,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 "" } +}