re PR c++/27270 (ICE in process_init_constructor_array, at cp/typeck2.c:788)

PR c++/27270
	* typeck2.c (process_init_constructor_array): Reword comment.
	* pt.c (tsubst_copy_and_built): Call reshape_init before calling
	digest_init.
	PR c++/27270
	* g++.dg/ext/complit8.C: New test.

From-SVN: r117814
This commit is contained in:
Mark Mitchell 2006-10-17 02:01:27 +00:00 committed by Mark Mitchell
parent 26da58ddfa
commit fb8549a1d7
5 changed files with 26 additions and 3 deletions

View file

@ -1,5 +1,10 @@
2006-10-16 Mark Mitchell <mark@codesourcery.com>
PR c++/27270
* typeck2.c (process_init_constructor_array): Reword comment.
* pt.c (tsubst_copy_and_built): Call reshape_init before calling
digest_init.
PR c++/29408
* parser.c (cp_parser_using_declaration): Stop parsing when
something goes wrong with an access declaration.

View file

@ -9351,7 +9351,10 @@ tsubst_copy_and_build (tree t,
TREE_HAS_CONSTRUCTOR (r) = TREE_HAS_CONSTRUCTOR (t);
if (type)
return digest_init (type, r);
{
r = reshape_init (type, r);
return digest_init (type, r);
}
return r;
}

View file

@ -791,8 +791,8 @@ process_init_constructor_array (tree type, tree init)
/* Vectors are like simple fixed-size arrays. */
len = TYPE_VECTOR_SUBPARTS (type);
/* There cannot be more initializers than needed (or reshape_init would
detect this before we do. */
/* There cannot be more initializers than needed as otherwise
reshape_init would have already rejected the initializer. */
if (!unbounded)
gcc_assert (VEC_length (constructor_elt, v) <= len);

View file

@ -1,5 +1,8 @@
2006-10-16 Mark Mitchell <mark@codesourcery.com>
PR c++/27270
* g++.dg/ext/complit8.C: New test.
PR c++/29408
* g++.dg/parse/dtor12.C: New test.

View file

@ -0,0 +1,12 @@
// PR c++/27270
// { dg-options "" }
template<typename Entry>
struct Array {
Entry *array[32];
Array () :
array ( (Entry*[1]) { 0, 0 } ) // { dg-error "initializers|conversion" }
{}
};
Array<void*> a;