diff options
author | Jason Merrill <jason@redhat.com> | 2014-02-21 09:57:00 -0500 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2014-02-21 09:57:00 -0500 |
commit | 07874b2486b101bd807dd183326da3e7d064de7a (patch) | |
tree | ba5977ab9f0c21e00604112fc244a2f57daff8ca /gcc | |
parent | 843633f841be49bf6d15a2f6208ce384870f37b8 (diff) | |
download | gcc-07874b2486b101bd807dd183326da3e7d064de7a.zip gcc-07874b2486b101bd807dd183326da3e7d064de7a.tar.gz gcc-07874b2486b101bd807dd183326da3e7d064de7a.tar.bz2 |
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
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cp/ChangeLog | 3 | ||||
-rw-r--r-- | gcc/cp/pt.c | 2 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/cpp0x/variadic150.C | 9 |
3 files changed, 14 insertions, 0 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 62aacd6..9ddd8f8 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -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++/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 0f576a5..bf41e865 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 0000000..6a30efe --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/variadic150.C @@ -0,0 +1,9 @@ +// PR c++/60219 +// { dg-require-effective-target c++11 } + +template<typename..., int> void foo(); + +void bar() +{ + foo<0>; // { dg-error "" } +} |