Commit ee7ecb29 by Mark Mitchell Committed by Mark Mitchell

re PR c++/8688 (ICE with segfault on missing comma in initializer of 2D array.)

	PR c++/8688
	* decl.c (reshape_init): Handle erroneous initializers.

	PR c++/8688
	* g++.dg/init/brace3.C: New test.

From-SVN: r59768
parent 67f05dcb
2002-12-03 Mark Mitchell <mark@codesourcery.com>
PR c++/8688
* decl.c (reshape_init): Handle erroneous initializers.
2002-12-02 Mark Mitchell <mark@codesourcery.com>
PR c++/8720
......
......@@ -7793,6 +7793,14 @@ reshape_init (tree type, tree *initp)
old_init_value = (TREE_CODE (*initp) == TREE_LIST
? TREE_VALUE (*initp) : old_init);
/* For some parse errors, OLD_INIT_VALUE may be NULL. */
if (!old_init_value)
{
my_friendly_assert (TREE_CODE (old_init) == TREE_LIST, 20021202);
TREE_VALUE (old_init) = error_mark_node;
return old_init;
}
/* If the initializer is brace-enclosed, pull initializers from the
enclosed elements. Advance past the brace-enclosed initializer
now. */
......
2002-12-03 Mark Mitchell <mark@codesourcery.com>
PR c++/8688
* g++.dg/init/brace3.C: New test.
2002-12-02 Kazu Hirata <kazu@cs.umass.edu>
* gcc.dg/20020210-1.c: Fix a comment typo.
......
int array[2][1] = { {0} {1} }; // { dg-error "" }
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