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
This commit is contained in:
Paolo Carlini 2012-01-23 17:56:42 +00:00 committed by Paolo Carlini
parent e617b554f8
commit 1beb527252
4 changed files with 19 additions and 0 deletions

View File

@ -1,3 +1,8 @@
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>
PR c++/51925

View File

@ -8157,6 +8157,9 @@ parameter_of_template_p (tree parm, tree templ)
for (i = 0; i < TREE_VEC_LENGTH (parms); ++i)
{
tree p = TREE_VALUE (TREE_VEC_ELT (parms, i));
if (p == error_mark_node)
continue;
if (parm == p
|| (DECL_INITIAL (parm)
&& DECL_INITIAL (parm) == DECL_INITIAL (p)))

View File

@ -1,3 +1,8 @@
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>
* ada/acats/tests/cxh/cxh1001.a: Removed, test not suitable on all

View File

@ -0,0 +1,6 @@
// PR c++/51398
template<void, int N> struct A // { dg-error "not a valid type" }
{
static const int i = N;
};