Commit ca5333f2 by Jason Merrill Committed by Jason Merrill

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

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

From-SVN: r183132
parent 458652d1
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> 2012-01-11 Jason Merrill <jason@redhat.com>
PR c++/51565 PR c++/51565
......
...@@ -16272,6 +16272,8 @@ unify (tree tparms, tree targs, tree parm, tree arg, int strict, ...@@ -16272,6 +16272,8 @@ unify (tree tparms, tree targs, tree parm, tree arg, int strict,
idx = TEMPLATE_TYPE_IDX (parm); idx = TEMPLATE_TYPE_IDX (parm);
targ = TREE_VEC_ELT (INNERMOST_TEMPLATE_ARGS (targs), idx); targ = TREE_VEC_ELT (INNERMOST_TEMPLATE_ARGS (targs), idx);
tparm = TREE_VALUE (TREE_VEC_ELT (tparms, 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. */ /* Check for mixed types and values. */
if ((TREE_CODE (parm) == TEMPLATE_TYPE_PARM if ((TREE_CODE (parm) == TEMPLATE_TYPE_PARM
......
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> 2012-01-12 Ira Rosen <irar@il.ibm.com>
PR tree-optimization/51799 PR tree-optimization/51799
......
template<typename T, void, typename U> // { dg-error "void" }
void foo(T, U, int) {}
void bar()
{
foo(0, 0, 0); // { dg-error "no match" }
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment