parse.y (patch_assignment): Use lvalue's original TYPE when building the final COMPOU...
authorAlexandre Petit-Bianco <apbianco@redhat.com>
Thu, 4 Oct 2001 02:58:39 +0000 (19:58 -0700)
committerAlexandre Petit-Bianco <apbianco@gcc.gnu.org>
Thu, 4 Oct 2001 02:58:39 +0000 (19:58 -0700)
2001-10-03  Alexandre Petit-Bianco  <apbianco@redhat.com>

* parse.y (patch_assignment): Use lvalue's original TYPE when
building the final COMPOUND_EXPR.
(try_reference_assignconv): Fixed leading comment.

( http://gcc.gnu.org/ml/java-patches/2001-q4/msg00027.html )

From-SVN: r46004

gcc/java/ChangeLog
gcc/java/parse.y

index 53b1ce6dc43dc6cba26b2577ecf7d452976439b3..71fdf9251b4637d032e530e84aa2f0cd5c66758a 100644 (file)
@@ -1,3 +1,9 @@
+2001-10-03  Alexandre Petit-Bianco  <apbianco@redhat.com>
+
+       * parse.y (patch_assignment): Use lvalue's original TYPE when
+       building the final COMPOUND_EXPR.
+       (try_reference_assignconv): Fixed leading comment.
+
 2001-09-26  Alexandre Petit-Bianco  <apbianco@redhat.com>
 
        * parse.y (check_final_variable_indirect_assignment): For
index 154fef3f699e3c90e4f90c418c349fb275465aba..6fa305486d42c6afb2adc5119ad10c12f6f62d2e 100644 (file)
@@ -13002,10 +13002,11 @@ patch_assignment (node, wfl_op1, wfl_op2)
             build (COMPOUND_EXPR, void_type_node, bound_check, check);
 
           /* Re-assemble the augmented array access. */
-          lvalue = build (COMPOUND_EXPR, lhs_type, new_compound, lvalue);
+          lvalue = build (COMPOUND_EXPR, TREE_TYPE (lvalue),
+                         new_compound, lvalue);
         }
       else
-        lvalue = build (COMPOUND_EXPR, lhs_type, check, lvalue);
+        lvalue = build (COMPOUND_EXPR, TREE_TYPE (lvalue), check, lvalue);
     }
 
   /* Final locals can be used as case values in switch
@@ -13028,9 +13029,8 @@ patch_assignment (node, wfl_op1, wfl_op2)
 }
 
 /* Check that type SOURCE can be cast into type DEST. If the cast
-   can't occur at all, return 0 otherwise 1. This function is used to
-   produce accurate error messages on the reasons why an assignment
-   failed. */
+   can't occur at all, return NULL; otherwise, return a possibly
+   modified rhs.  */
 
 static tree
 try_reference_assignconv (lhs_type, rhs)