* semantics.c (finish_switch_cond): Handle error cases gracefully.
Detected by g++.law/enum5.C
* typeck.c (build_modify_expr): Check for errors after resolving
offsets. Detected by g++.brendan/static1.C
* decl.c (complete_array_type): Ignore initial_value if it is an
error. Detected by g++.benjamin/17930.C
* typeck2.c (process_init_constructor): Return error if one argument
is in error. Detected by g++.benjamin/13478.C
From-SVN: r25740
+1999-03-13 Martin von Löwis <loewis@informatik.hu-berlin.de>
+
+ * semantics.c (finish_switch_cond): Handle error cases gracefully.
+ Detected by g++.law/enum5.C
+
+ * typeck.c (build_modify_expr): Check for errors after resolving
+ offsets. Detected by g++.brendan/static1.C
+
+ * decl.c (complete_array_type): Ignore initial_value if it is an
+ error. Detected by g++.benjamin/17930.C
+
+ * typeck2.c (process_init_constructor): Return error if one argument
+ is in error. Detected by g++.benjamin/13478.C
+
1999-03-12 Martin von Löwis <loewis@informatik.hu-berlin.de>
* decl.c (select_decl): Allow class templates when we need types.
/* Make an error message unless that happened already. */
if (initial_value != error_mark_node)
value = 1;
+ else
+ initial_value = NULL_TREE;
/* Prevent further error messages. */
maxindex = build_int_2 (0, 0);
r = build_min_nt (SWITCH_STMT, cond, NULL_TREE);
add_tree (r);
}
- else
+ else if (cond != error_mark_node)
{
emit_line_note (input_filename, lineno);
c_expand_start_case (cond);
r = NULL_TREE;
}
+ else
+ {
+ /* The code is in error, but we don't want expand_end_case to
+ crash. */
+ c_expand_start_case (boolean_false_node);
+ r = NULL_TREE;
+ }
+
push_switch ();
/* Don't let the tree nodes for COND be discarded by
olhstype = lhstype = TREE_TYPE (lhs);
}
+ if (lhs == error_mark_node)
+ return lhs;
+
if (TREE_CODE (lhstype) == REFERENCE_TYPE
&& modifycode != INIT_EXPR)
{
tree tail1 = tail;
next1 = digest_init (TREE_TYPE (type),
TREE_VALUE (tail), &tail1);
+ if (next1 == error_mark_node)
+ return next1;
my_friendly_assert
(same_type_p (TYPE_MAIN_VARIANT (TREE_TYPE (type)),
TYPE_MAIN_VARIANT (TREE_TYPE (next1))),