aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/cp/ChangeLog6
-rw-r--r--gcc/cp/call.c5
-rw-r--r--gcc/cp/typeck.c2
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 <nathan@codesourcery.com>
+
+ * typeck.c (convert_for_assignment): Don't look at array
+ initializer.
+ * call.c (convert_like_real): Likewise.
+
2000-03-07 Jason Merrill <jason@casey.cygnus.com>
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]