* stmt.c (expand_return): If an attempt is made to return the
error_mar_node, treat the return like a return without a value.
From-SVN: r39924
+2001-02-20 Mark Mitchell <mark@codesourcery.com>
+
+ * stmt.c (expand_return): If an attempt is made to return the
+ error_mar_node, treat the return like a return without a value.
+
2001-02-19 Zack Weinberg <zackw@stanford.edu>
* sibcall.c (skip_copy_to_return_value): Call
* class.c (check_field_decls): Don't special case anonymous
fields in error messages.
- (note_name_declared_inpwdpwd
- _class): Use %D on diagnostic.
+ (note_name_declared_in_class): Use %D on diagnostic.
* tree.c (pod_type_p): Use strip_array_types.
(cp_valid_lang_attribute): Likewise.
#endif
if (retval == error_mark_node)
- retval_rhs = NULL_TREE;
+ {
+ /* Treat this like a return of no value from a function that
+ returns a value. */
+ expand_null_return ();
+ return;
+ }
else if (TREE_CODE (retval) == RESULT_DECL)
retval_rhs = retval;
else if ((TREE_CODE (retval) == MODIFY_EXPR || TREE_CODE (retval) == INIT_EXPR)
--- /dev/null
+// Build don't link:
+// Special g++ Option:
+// Origin: holmen@mail.nu
+
+struct C {
+ int f() {return 0;}
+};
+
+struct D {
+ C a[1];
+ C* g();
+};
+
+C* D::g() {
+ int i = 0;
+ while (i < 1 && a[i].f() != 1) {}
+ return undefined_variable; // ERROR -
+}