+2004-09-09 James E Wilson <wilson@specifixinc.com>
+
+ * c-typeck.c (convert_for_assignment): Check that rhs has VECTOR_TYPE
+ before calling vector_types_convertible_p.
+ (digest_init): Check that inside_init has VECTOR_TYPE before calling
+ vector_types_convertible_p. Don't give another error if
+ convert_for_assignment returns error_mark_node.
+
2004-09-09 Roger Sayle <roger@eyesopen.com>
PR middle-end/17055
return rhs;
}
/* Some types can interconvert without explicit casts. */
- else if (codel == VECTOR_TYPE
+ else if (codel == VECTOR_TYPE && coder == VECTOR_TYPE
&& vector_types_convertible_p (type, TREE_TYPE (rhs)))
return convert (type, rhs);
/* Arithmetic types all interconvert, and enum is treated like int. */
vector constructor is not constant (e.g. {1,2,3,foo()}) then punt
below and handle as a constructor. */
if (code == VECTOR_TYPE
+ && TREE_CODE (TREE_TYPE (inside_init)) == VECTOR_TYPE
&& vector_types_convertible_p (TREE_TYPE (inside_init), type)
&& TREE_CONSTANT (inside_init))
{
= convert_for_assignment (type, init, _("initialization"),
NULL_TREE, NULL_TREE, 0);
- if (require_constant && ! TREE_CONSTANT (inside_init))
+ /* Check to see if we have already given an error message. */
+ if (inside_init == error_mark_node)
+ ;
+ else if (require_constant && ! TREE_CONSTANT (inside_init))
{
error_init ("initializer element is not constant");
inside_init = error_mark_node;