Commit 1beb5272 by Paolo Carlini Committed by Paolo Carlini

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

/cp
2012-01-23  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/51398
	* pt.c (parameter_of_template_p): Skip error_mark_node parameters.

/testsuite
2012-01-23  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/51398
	* g++.dg/template/crash111.C: New.

From-SVN: r183445
parent e617b554
2012-01-23 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/51398
* pt.c (parameter_of_template_p): Skip error_mark_node parameters.
2012-01-23 Jason Merrill <jason@redhat.com> 2012-01-23 Jason Merrill <jason@redhat.com>
PR c++/51925 PR c++/51925
......
...@@ -8157,6 +8157,9 @@ parameter_of_template_p (tree parm, tree templ) ...@@ -8157,6 +8157,9 @@ parameter_of_template_p (tree parm, tree templ)
for (i = 0; i < TREE_VEC_LENGTH (parms); ++i) for (i = 0; i < TREE_VEC_LENGTH (parms); ++i)
{ {
tree p = TREE_VALUE (TREE_VEC_ELT (parms, i)); tree p = TREE_VALUE (TREE_VEC_ELT (parms, i));
if (p == error_mark_node)
continue;
if (parm == p if (parm == p
|| (DECL_INITIAL (parm) || (DECL_INITIAL (parm)
&& DECL_INITIAL (parm) == DECL_INITIAL (p))) && DECL_INITIAL (parm) == DECL_INITIAL (p)))
......
2012-01-23 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/51398
* g++.dg/template/crash111.C: New.
2012-01-23 Arnaud Charlet <charlet@adacore.com> 2012-01-23 Arnaud Charlet <charlet@adacore.com>
* ada/acats/tests/cxh/cxh1001.a: Removed, test not suitable on all * ada/acats/tests/cxh/cxh1001.a: Removed, test not suitable on all
......
// PR c++/51398
template<void, int N> struct A // { dg-error "not a valid type" }
{
static const int i = N;
};
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