re PR c++/27019 (ICE with designated initializers)

PR c++/27019
	* typeck2.c (process_init_constructor_array): Set ce->value on errors.

From-SVN: r114952
This commit is contained in:
Steve Ellcey 2006-06-23 21:53:36 +00:00 committed by Steve Ellcey
parent 5fc89bfdd7
commit e135a63713
2 changed files with 13 additions and 2 deletions

View File

@ -1,3 +1,8 @@
2006-06-23 Steve Ellcey <sje@cup.hp.com>
PR c++/27019
* typeck2.c (process_init_constructor_array): Set ce->value on errors.
2006-06-23 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
PR c++/28112

View File

@ -797,7 +797,10 @@ process_init_constructor_array (tree type, tree init)
{
gcc_assert (TREE_CODE (ce->index) == INTEGER_CST);
if (compare_tree_int (ce->index, i) != 0)
sorry ("non-trivial designated initializers not supported");
{
ce->value = error_mark_node;
sorry ("non-trivial designated initializers not supported");
}
}
else
ce->index = size_int (i);
@ -895,7 +898,10 @@ process_init_constructor_record (tree type, tree init)
|| TREE_CODE (ce->index) == IDENTIFIER_NODE);
if (ce->index != field
&& ce->index != DECL_NAME (field))
sorry ("non-trivial designated initializers not supported");
{
ce->value = error_mark_node;
sorry ("non-trivial designated initializers not supported");
}
}
gcc_assert (ce->value);