OSDN Git Service

* method.c (emit_thunk): Don't try to return a `void' value.
authormmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 30 Apr 2000 18:03:36 +0000 (18:03 +0000)
committermmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 30 Apr 2000 18:03:36 +0000 (18:03 +0000)
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@33554 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/cp/ChangeLog
gcc/cp/method.c

index 3c75429..fbfd16b 100644 (file)
@@ -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.
index 31b02be..ff1237e 100644 (file)
@@ -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.  */