Commit c9407e4c by Mark Mitchell

stmt.c (expand_return): If an attempt is made to return the error_mar_node...

	* 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
parent 0cbd3980
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
......
......@@ -1075,8 +1075,7 @@ Sun Feb 4 15:52:44 2001 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
* 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.
......
......@@ -2946,7 +2946,12 @@ expand_return (retval)
#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)
......
// 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 -
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment