From 98d64f692f4119a8d93cc49cc2d63976298a47f8 Mon Sep 17 00:00:00 2001 From: Richard Kenner Date: Mon, 10 Apr 2000 11:59:46 +0000 Subject: [PATCH] c-convert.c (convert): Handle REFERENCE_TYPE like POINTER_TYPE. * c-convert.c (convert): Handle REFERENCE_TYPE like POINTER_TYPE. * c-typeck.c (convert_for_assignment): Likewise. From-SVN: r33058 --- gcc/ChangeLog | 3 +++ gcc/c-convert.c | 2 +- gcc/c-typeck.c | 3 ++- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 333d0f5c3a1..191d4443403 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,8 @@ Mon Apr 10 07:21:13 2000 Richard Kenner + * 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. diff --git a/gcc/c-convert.c b/gcc/c-convert.c index b3b144d6a8b..8dc85509d74 100644 --- a/gcc/c-convert.c +++ b/gcc/c-convert.c @@ -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)); diff --git a/gcc/c-typeck.c b/gcc/c-typeck.c index 0d395a2b3d4..62a3b256469 100644 --- a/gcc/c-typeck.c +++ b/gcc/c-typeck.c @@ -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); -- 2.30.2