re PR c++/51403 (ICE with invalid template parameter)

PR c++/51403
	* pt.c (unify): Handle error_mark_node.

From-SVN: r183132
This commit is contained in:
Jason Merrill 2012-01-12 12:26:57 -05:00 committed by Jason Merrill
parent 458652d1ea
commit ca5333f22c
4 changed files with 19 additions and 0 deletions

View File

@ -1,3 +1,8 @@
2012-01-12 Jason Merrill <jason@redhat.com>
PR c++/51403
* pt.c (unify): Handle error_mark_node.
2012-01-11 Jason Merrill <jason@redhat.com>
PR c++/51565

View File

@ -16272,6 +16272,8 @@ unify (tree tparms, tree targs, tree parm, tree arg, int strict,
idx = TEMPLATE_TYPE_IDX (parm);
targ = TREE_VEC_ELT (INNERMOST_TEMPLATE_ARGS (targs), idx);
tparm = TREE_VALUE (TREE_VEC_ELT (tparms, idx));
if (tparm == error_mark_node)
return unify_invalid (explain_p);
/* Check for mixed types and values. */
if ((TREE_CODE (parm) == TEMPLATE_TYPE_PARM

View File

@ -1,3 +1,8 @@
2012-01-12 Jason Merrill <jason@redhat.com>
PR c++/51403
* g++.dg/template/arg8.C: New.
2012-01-12 Ira Rosen <irar@il.ibm.com>
PR tree-optimization/51799

View File

@ -0,0 +1,7 @@
template<typename T, void, typename U> // { dg-error "void" }
void foo(T, U, int) {}
void bar()
{
foo(0, 0, 0); // { dg-error "no match" }
}