decl.c (finish_constructor_body): Don't set the return value of the constructor if...
authorAndrew Haley <aph@redhat.com>
Tue, 1 Jul 2008 12:56:08 +0000 (12:56 +0000)
committerAndrew Haley <aph@gcc.gnu.org>
Tue, 1 Jul 2008 12:56:08 +0000 (12:56 +0000)
2008-07-01  Andrew Haley  <aph@redhat.com>

        * decl.c (finish_constructor_body): Don't set the return value of
        the constructor if the constructor is that of a Java type.

From-SVN: r137317

gcc/cp/ChangeLog
gcc/cp/decl.c

index dd40a29200583ef809afff53fe036a8d11be3e35..c9b04e3e2f287a6a788ddb14e104e552857dbd1e 100644 (file)
@@ -1,3 +1,8 @@
+2008-07-01  Andrew Haley  <aph@redhat.com>
+
+       * decl.c (finish_constructor_body): Don't set the return value of
+       the constructor if the constructor is that of a Java type.
+
 2008-06-30  Jakub Jelinek  <jakub@redhat.com>
 
        PR c++/36662
index 32be05cc7c33e2c38eafa3e80b93c513fd5e25cf..c6ae93e6104343fcdb49e4a1f2198e2105bcc7bf 100644 (file)
@@ -11606,7 +11606,8 @@ finish_constructor_body (void)
   tree val;
   tree exprstmt;
 
-  if (targetm.cxx.cdtor_returns_this ())
+  if (targetm.cxx.cdtor_returns_this ()
+      && (! TYPE_FOR_JAVA (current_class_type)))
     {
       /* Any return from a constructor will end up here.  */
       add_stmt (build_stmt (LABEL_EXPR, cdtor_label));