c-convert.c (convert): Handle REFERENCE_TYPE like POINTER_TYPE.
authorRichard Kenner <kenner@vlsi1.ultra.nyu.edu>
Mon, 10 Apr 2000 11:59:46 +0000 (11:59 +0000)
committerRichard Kenner <kenner@gcc.gnu.org>
Mon, 10 Apr 2000 11:59:46 +0000 (07:59 -0400)
* c-convert.c (convert): Handle REFERENCE_TYPE like POINTER_TYPE.
* c-typeck.c (convert_for_assignment): Likewise.

From-SVN: r33058

gcc/ChangeLog
gcc/c-convert.c
gcc/c-typeck.c

index 333d0f5c3a18a4ffd2960ed012fda8a125c3467a..191d444340334e3c98db83a598fc63632c68f079 100644 (file)
@@ -1,5 +1,8 @@
 Mon Apr 10 07:21:13 2000  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
 
+       * c-convert.c (convert): Handle REFERENCE_TYPE like POINTER_TYPE.
+       * c-typeck.c (convert_for_assignment): Likewise.
+
        * expmed.c (init_expmed): Don't free objects we make.
        * emit-rtl.c (gen_rtx_CONST_INT, init_emit_once): Minor cleanups.
 
index b3b144d6a8bc618bf85fd7f8371f090f4e58f80d..8dc85509d742c5aeb13c04c6a4b3a9690b769bc6 100644 (file)
@@ -88,7 +88,7 @@ convert (type, expr)
 #endif
   if (code == INTEGER_TYPE || code == ENUMERAL_TYPE)
     return fold (convert_to_integer (type, e));
-  if (code == POINTER_TYPE)
+  if (code == POINTER_TYPE || code == REFERENCE_TYPE)
     return fold (convert_to_pointer (type, e));
   if (code == REAL_TYPE)
     return fold (convert_to_real (type, e));
index 0d395a2b3d475c89d70ac416b4682b3c96a0ef72..62a3b256469b4edc2e93261435a73909dfdaa70d 100644 (file)
@@ -4082,7 +4082,8 @@ convert_for_assignment (type, rhs, errtype, fundecl, funname, parmnum)
     }
 
   /* Conversions among pointers */
-  else if (codel == POINTER_TYPE && coder == POINTER_TYPE)
+  else if ((codel == POINTER_TYPE || codel == REFERENCE_TYPE)
+          && (coder == POINTER_TYPE || coder == REFERENCE_TYPE))
     {
       register tree ttl = TREE_TYPE (type);
       register tree ttr = TREE_TYPE (rhstype);