From 2abda41888b697574683e355e92fe5cd40dff3c5 Mon Sep 17 00:00:00 2001 From: Nathan Sidwell Date: Wed, 8 Mar 2000 10:26:06 +0000 Subject: [PATCH] typeck.c (convert_for_assignment): Don't look at array initializer. * typeck.c (convert_for_assignment): Don't look at array initializer. * call.c (convert_like_real): Likewise. From-SVN: r32415 --- gcc/cp/ChangeLog | 6 ++++++ gcc/cp/call.c | 5 +++-- gcc/cp/typeck.c | 2 +- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 4b7c03c..948ea7d 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2000-03-08 Nathan Sidwell + + * typeck.c (convert_for_assignment): Don't look at array + initializer. + * call.c (convert_like_real): Likewise. + 2000-03-07 Jason Merrill Add initial support for '\uNNNN' specifier. diff --git a/gcc/cp/call.c b/gcc/cp/call.c index 0589cfd..6e3eabd 100644 --- a/gcc/cp/call.c +++ b/gcc/cp/call.c @@ -3683,10 +3683,11 @@ convert_like_real (convs, expr, fn, argnum, inner) if (expr == error_mark_node) return error_mark_node; - /* Convert a constant variable to its underlying value, unless we + /* Convert a non-array constant variable to its underlying value, unless we are about to bind it to a reference, in which case we need to leave it as an lvalue. */ - if (TREE_READONLY_DECL_P (expr) && TREE_CODE (convs) != REF_BIND) + if (TREE_READONLY_DECL_P (expr) && TREE_CODE (convs) != REF_BIND + && TREE_CODE (TREE_TYPE (expr)) != ARRAY_TYPE) expr = decl_constant_value (expr); switch (TREE_CODE (convs)) diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c index a47b088..071d2ee 100644 --- a/gcc/cp/typeck.c +++ b/gcc/cp/typeck.c @@ -6523,7 +6523,7 @@ convert_for_assignment (type, rhs, errtype, fndecl, parmnum) /* Simplify the RHS if possible. */ if (TREE_CODE (rhs) == CONST_DECL) rhs = DECL_INITIAL (rhs); - else if (TREE_READONLY_DECL_P (rhs)) + else if (TREE_READONLY_DECL_P (rhs) && coder != ARRAY_TYPE) rhs = decl_constant_value (rhs); /* [expr.ass] -- 2.7.4