+2001-11-14 Richard Sandiford <rsandifo@redhat.com>
+
+ * decl.c (check_initializer): Try to complete the type of an
+ array element before checking whether it's complete. Don't
+ complain about arrays with complete element types but an
+ unknown size.
+ (cp_finish_decl): Build the hierarchical constructor before
+ calling maybe_deduce_size_from_array_init.
+
2001-11-14 Joseph S. Myers <jsm28@cam.ac.uk>
* Make-lang.in: Change all uses of $(manext) to $(man1ext).
init = NULL_TREE;
}
else if (TREE_CODE (type) == ARRAY_TYPE
- && !COMPLETE_TYPE_P (TREE_TYPE (type)))
+ && !COMPLETE_TYPE_P (complete_type (TREE_TYPE (type))))
{
cp_error ("elements of array `%#D' have incomplete type", decl);
init = NULL_TREE;
}
- else if (!COMPLETE_TYPE_P (type))
+ else if (TREE_CODE (type) != ARRAY_TYPE && !COMPLETE_TYPE_P (type))
{
cp_error ("`%D' has incomplete type", decl);
TREE_TYPE (decl) = error_mark_node;
}
/* Deduce size of array from initialization, if not already known. */
- maybe_deduce_size_from_array_init (decl, init);
init = check_initializer (decl, init);
+ maybe_deduce_size_from_array_init (decl, init);
GNU_xref_decl (current_function_decl, decl);