diff options
Diffstat (limited to 'gcc/cp/method.c')
-rw-r--r-- | gcc/cp/method.c | 5 |
1 files changed, 4 insertions, 1 deletions
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. */ |