* 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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@117814
138bc75d-0d04-0410-961f-
82ee72b054a4
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.
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;
}
/* 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);
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.
--- /dev/null
+// 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;