diff options
-rw-r--r-- | gcc/cp/ChangeLog | 2 | ||||
-rw-r--r-- | gcc/cp/method.c | 5 |
2 files changed, 6 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 3c75429..fbfd16b 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,7 @@ 2000-04-30 Mark Mitchell <mark@codesourcery.com> + * method.c (emit_thunk): Don't try to return a `void' value. + * optimize.c (initialize_inlined_parameters): If the parameter is addressable, we need to make a new VAR_DECL, even if the initializer is constant. diff --git a/gcc/cp/method.c b/gcc/cp/method.c index 31b02be..ff1237e 100644 --- a/gcc/cp/method.c +++ b/gcc/cp/method.c @@ -2187,7 +2187,10 @@ emit_thunk (thunk_fndecl) t = tree_cons (NULL_TREE, a, t); t = nreverse (t); t = build_call (function, t); - finish_return_stmt (t); + if (!same_type_p (TREE_TYPE (t), void_type_node)) + finish_return_stmt (t); + else + finish_expr_stmt (t); /* The back-end expects DECL_INITIAL to contain a BLOCK, so we clear this here. */ |